app/models/spotlight/exhibit.rb in blacklight-spotlight-2.7.2 vs app/models/spotlight/exhibit.rb in blacklight-spotlight-2.8.0
- old
+ new
@@ -34,10 +34,20 @@
# Note: friendly id associations need to be 'destroy'ed to reap the slug history
has_many :about_pages, -> { for_default_locale }, extend: FriendlyId::FinderMethods
has_many :attachments, dependent: :destroy
has_many :contact_emails, dependent: :delete_all # These are the contacts who get "Contact us" emails
has_many :contacts, dependent: :delete_all # These are the contacts who appear in the sidebar
- has_many :custom_fields, dependent: :delete_all
+ has_many :custom_fields, dependent: :delete_all do
+ def as_strong_params
+ multivalued_params, single_valued_params = writeable.partition(&:is_multiple?)
+ single_valued_params.pluck(:slug, :field).flatten +
+ [multivalued_params.each_with_object({}) do |f, h|
+ h[f.slug] = []
+ h[f.field] = []
+ end]
+ end
+ end
+
has_many :feature_pages, -> { for_default_locale }, extend: FriendlyId::FinderMethods
has_many :main_navigations, dependent: :delete_all
has_many :reindexing_log_entries, dependent: :destroy
has_many :resources
has_many :roles, as: :resource, dependent: :delete_all