@@ -4,7 +4,6 @@ class Admin::EditionsController < Admin::BaseController
44
55 before_action :remove_blank_parameters
66 before_action :clean_edition_parameters , only : %i[ create update ]
7- before_action :destroy_blank_social_media_accounts , only : %i[ create update ]
87 before_action :clear_scheduled_publication_if_not_activated , only : %i[ create update ]
98 before_action :clear_response_form_file_cache , only : %i[ create update ]
109 before_action :find_edition , only : %i[ show edit update revise diff confirm_destroy destroy update_bypass_id update_image_display_option ]
@@ -293,7 +292,6 @@ def permitted_edition_attributes
293292 default_news_image_attributes : %i[ file file_cache id ] ,
294293 nation_inapplicabilities_attributes : %i[ id nation_id alternative_url excluded ] ,
295294 fatality_notice_casualties_attributes : %i[ id personal_details _destroy ] ,
296- social_media_accounts_attributes : %i[ social_media_service_id url title _destroy id ] ,
297295 document_attributes : [
298296 :id ,
299297 :slug ,
@@ -472,16 +470,6 @@ def clean_edition_parameters
472470 end
473471 end
474472
475- def destroy_blank_social_media_accounts
476- if edition_params [ :social_media_accounts_attributes ]
477- edition_params [ :social_media_accounts_attributes ] . each_pair do |_key , account |
478- if account [ :social_media_service_id ] . blank? && account [ :url ] . blank? && account [ :title ] . blank?
479- account [ :_destroy ] = "1"
480- end
481- end
482- end
483- end
484-
485473 def clear_scheduled_publication_if_not_activated
486474 if params [ :scheduled_publication_active ] && params [ :scheduled_publication_active ] . to_i . zero?
487475 edition_params . keys . each do |key |
0 commit comments