Sha256: 39c648db89c28fbf3ba6359ad8c73f424ed22adbe57f70665a76122939fe2240
Contents?: true
Size: 641 Bytes
Versions: 104
Compression:
Stored size: 641 Bytes
Contents
class RemoveSearchableFromExhibit < ActiveRecord::Migration[4.2] def up Spotlight::Exhibit.where(searchable: false).find_each do |e| e.home_page.update(display_sidebar: false) end Spotlight::Exhibit.where(searchable: true).find_each do |e| key = e.blacklight_configuration.default_blacklight_config.default_search_field.key e.blacklight_configuration.search_fields[key] ||= {} e.blacklight_configuration.search_fields[key][:enabled] = true end remove_column :spotlight_exhibits, :searchable end def down add_column :spotlight_exhibits, :searchable, :boolean, default: true end end
Version data entries
104 entries across 104 versions & 1 rubygems