Skip to content

Commit

Permalink
Coder: YAML change
Browse files Browse the repository at this point in the history
  • Loading branch information
whisere authored Jan 30, 2024
1 parent 1a7448e commit 58cf6d2
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 16 deletions.
18 changes: 9 additions & 9 deletions app/models/spotlight/blacklight_configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion app/models/spotlight/contact.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion app/models/spotlight/custom_field.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion app/models/spotlight/custom_search_field.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion app/models/spotlight/exhibit.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion app/models/spotlight/resource.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions app/models/spotlight/solr_document_sidecar.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 58cf6d2

Please sign in to comment.