Skip to content

Commit

Permalink
Update existing exhibits to hide new fields by default.
Browse files Browse the repository at this point in the history
  • Loading branch information
cbeer committed Sep 16, 2024
1 parent ac10c7a commit 0e41314
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
20 changes: 20 additions & 0 deletions db/migrate/20240916120405_update_blacklight_config_defaults.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
class UpdateBlacklightConfigDefaults < ActiveRecord::Migration[7.2]
def up
Spotlight::BlacklightConfiguration.reset_column_information

Spotlight::BlacklightConfiguration.find_each do |config|
config.update(
facet_fields: config.facet_fields.reverse_merge({
'name_ssim' => { 'show' => false },
'name_roles_ssim' => { 'show' => false }
})
) unless config.facet_fields.blank?

config.update(
index_fields: config.facet_fields.reverse_merge({
'name_roles_ssim' => { 'enabled' => false, 'show' => false }
})
) unless config.index_fields.blank?
end
end
end
3 changes: 1 addition & 2 deletions db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema[7.0].define(version: 2022_06_20_180607) do
ActiveRecord::Schema[7.2].define(version: 2024_09_16_120405) do
create_table "bibliography_services", force: :cascade do |t|
t.string "header"
t.string "api_id"
Expand Down Expand Up @@ -519,5 +519,4 @@
t.text "custom_manifest_pattern"
t.index ["exhibit_id"], name: "index_viewers_on_exhibit_id"
end

end

0 comments on commit 0e41314

Please sign in to comment.