@@ -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 ]
@@ -292,7 +291,6 @@ def permitted_edition_attributes
292291 default_news_image_attributes : %i[ file file_cache id ] ,
293292 nation_inapplicabilities_attributes : %i[ id nation_id alternative_url excluded ] ,
294293 fatality_notice_casualties_attributes : %i[ id personal_details _destroy ] ,
295- social_media_accounts_attributes : %i[ social_media_service_id url title _destroy id ] ,
296294 document_attributes : [
297295 :id ,
298296 :slug ,
@@ -471,16 +469,6 @@ def clean_edition_parameters
471469 end
472470 end
473471
474- def destroy_blank_social_media_accounts
475- if edition_params [ :social_media_accounts_attributes ]
476- edition_params [ :social_media_accounts_attributes ] . each_pair do |_key , account |
477- if account [ :social_media_service_id ] . blank? && account [ :url ] . blank? && account [ :title ] . blank?
478- account [ :_destroy ] = "1"
479- end
480- end
481- end
482- end
483-
484472 def clear_scheduled_publication_if_not_activated
485473 if params [ :scheduled_publication_active ] && params [ :scheduled_publication_active ] . to_i . zero?
486474 edition_params . keys . each do |key |
0 commit comments