From 58cf6d2a04d2fc4921d7fa738d55e08a1013ac37 Mon Sep 17 00:00:00 2001 From: whisere Date: Wed, 31 Jan 2024 02:41:54 +1100 Subject: [PATCH] Coder: YAML change --- .../spotlight/blacklight_configuration.rb | 18 +++++++++--------- app/models/spotlight/contact.rb | 2 +- app/models/spotlight/custom_field.rb | 2 +- app/models/spotlight/custom_search_field.rb | 2 +- app/models/spotlight/exhibit.rb | 2 +- app/models/spotlight/resource.rb | 2 +- app/models/spotlight/solr_document_sidecar.rb | 4 ++-- 7 files changed, 16 insertions(+), 16 deletions(-) diff --git a/app/models/spotlight/blacklight_configuration.rb b/app/models/spotlight/blacklight_configuration.rb index 50a81aad8..8c545f884 100644 --- a/app/models/spotlight/blacklight_configuration.rb +++ b/app/models/spotlight/blacklight_configuration.rb @@ -10,15 +10,15 @@ class BlacklightConfiguration < ActiveRecord::Base has_paper_trail belongs_to :exhibit, touch: true, optional: true - serialize :facet_fields, Hash - serialize :index_fields, Hash - serialize :search_fields, Hash - serialize :sort_fields, Hash - serialize :default_solr_params, Hash - serialize :show, Hash - serialize :index, Hash - serialize :per_page, Array - serialize :document_index_view_types, Array + serialize :facet_fields, Hash, coder: YAML + serialize :index_fields, Hash, coder: YAML + serialize :search_fields, Hash, coder: YAML + serialize :sort_fields, Hash, coder: YAML + serialize :default_solr_params, Hash, coder: YAML + serialize :show, Hash, coder: YAML + serialize :index, Hash, coder: YAML + serialize :per_page, Array, coder: YAML + serialize :document_index_view_types, Array, coder: YAML include Spotlight::BlacklightConfigurationDefaults diff --git a/app/models/spotlight/contact.rb b/app/models/spotlight/contact.rb index 712b23b1d..13547cfc2 100644 --- a/app/models/spotlight/contact.rb +++ b/app/models/spotlight/contact.rb @@ -7,7 +7,7 @@ class Contact < ActiveRecord::Base belongs_to :exhibit, touch: true, optional: true scope :published, -> { where(show_in_sidebar: true) } default_scope { order('weight ASC') } - serialize :contact_info, Hash + serialize :contact_info, Hash, coder: YAML extend FriendlyId friendly_id :name, use: %i[slugged scoped finders], scope: :exhibit diff --git a/app/models/spotlight/custom_field.rb b/app/models/spotlight/custom_field.rb index 705859d9c..eecf4a3a5 100644 --- a/app/models/spotlight/custom_field.rb +++ b/app/models/spotlight/custom_field.rb @@ -4,7 +4,7 @@ module Spotlight ## # Exhibit custom fields class CustomField < ActiveRecord::Base - serialize :configuration, Hash + serialize :configuration, Hash, coder: YAML belongs_to :exhibit, optional: true extend FriendlyId diff --git a/app/models/spotlight/custom_search_field.rb b/app/models/spotlight/custom_search_field.rb index 5390ac187..86c2a4fb4 100644 --- a/app/models/spotlight/custom_search_field.rb +++ b/app/models/spotlight/custom_search_field.rb @@ -3,7 +3,7 @@ module Spotlight # Exhibit-specific custom search fields class CustomSearchField < ApplicationRecord - serialize :configuration, Hash + serialize :configuration, Hash, coder: YAML belongs_to :exhibit def label=(label) diff --git a/app/models/spotlight/exhibit.rb b/app/models/spotlight/exhibit.rb index c809abe96..51a248473 100644 --- a/app/models/spotlight/exhibit.rb +++ b/app/models/spotlight/exhibit.rb @@ -35,7 +35,7 @@ class Exhibit < ActiveRecord::Base acts_as_tagger acts_as_taggable delegate :blacklight_config, to: :blacklight_configuration - serialize :facets, Array + serialize :facets, Array, coder: YAML # NOTE: friendly id associations need to be 'destroy'ed to reap the slug history has_many :about_pages, -> { for_default_locale }, extend: FriendlyId::FinderMethods diff --git a/app/models/spotlight/resource.rb b/app/models/spotlight/resource.rb index 3c8be7f9b..3cdce9826 100644 --- a/app/models/spotlight/resource.rb +++ b/app/models/spotlight/resource.rb @@ -25,7 +25,7 @@ class Resource < ActiveRecord::Base has_many :solr_document_sidecars has_many :events, as: :resource - serialize :data, Hash + serialize :data, Hash, coder: YAML ## # Persist the record to the database, and trigger a reindex to solr diff --git a/app/models/spotlight/solr_document_sidecar.rb b/app/models/spotlight/solr_document_sidecar.rb index 85045722a..7ef0ef035 100644 --- a/app/models/spotlight/solr_document_sidecar.rb +++ b/app/models/spotlight/solr_document_sidecar.rb @@ -11,8 +11,8 @@ class SolrDocumentSidecar < ActiveRecord::Base belongs_to :exhibit, optional: false belongs_to :resource, optional: true belongs_to :document, optional: false, polymorphic: true - serialize :data, Hash - serialize :index_status, Hash + serialize :data, Hash, coder: YAML + serialize :index_status, Hash, coder: YAML delegate :has_key?, :key?, to: :data