Sha256: a9d0c30876aa1c431595ff526502194de4032fbde777d96db52b593c83761c03

Contents?: true

Size: 527 Bytes

Versions: 103

Compression:

Stored size: 527 Bytes

Contents

class AddSiteToSpotlightExhibits < ActiveRecord::Migration[4.2]
  def up
    add_column :spotlight_exhibits, :site_id, :integer
    add_index :spotlight_exhibits, :site_id

    add_default_site_to_exhibits
  end

  def down
    remove_column :spotlight_exhibits, :site_id, :integer
  end

  private

  def add_default_site_to_exhibits
    Spotlight::Site.reset_column_information
    Spotlight::Exhibit.reset_column_information

    Spotlight::Exhibit.find_each do |e|
      e.site = Spotlight::Site.instance
    end
  end
end

Version data entries

103 entries across 103 versions & 1 rubygems

Version Path
blacklight-spotlight-3.5.0.3 db/migrate/20151211131415_add_site_to_spotlight_exhibits.rb
blacklight-spotlight-3.6.0.beta6 db/migrate/20151211131415_add_site_to_spotlight_exhibits.rb
blacklight-spotlight-3.6.0.beta5 db/migrate/20151211131415_add_site_to_spotlight_exhibits.rb
blacklight-spotlight-3.6.0.beta4 db/migrate/20151211131415_add_site_to_spotlight_exhibits.rb
blacklight-spotlight-3.6.0.beta3 db/migrate/20151211131415_add_site_to_spotlight_exhibits.rb
blacklight-spotlight-3.6.0.beta1 db/migrate/20151211131415_add_site_to_spotlight_exhibits.rb
blacklight-spotlight-3.5.0.2 db/migrate/20151211131415_add_site_to_spotlight_exhibits.rb
blacklight-spotlight-3.5.0.1 db/migrate/20151211131415_add_site_to_spotlight_exhibits.rb
blacklight-spotlight-3.5.0 db/migrate/20151211131415_add_site_to_spotlight_exhibits.rb
blacklight-spotlight-3.4.4.1 db/migrate/20151211131415_add_site_to_spotlight_exhibits.rb
blacklight-spotlight-3.4.4 db/migrate/20151211131415_add_site_to_spotlight_exhibits.rb
blacklight-spotlight-3.4.3 db/migrate/20151211131415_add_site_to_spotlight_exhibits.rb
blacklight-spotlight-3.4.2.2 db/migrate/20151211131415_add_site_to_spotlight_exhibits.rb
blacklight-spotlight-3.4.2.1 db/migrate/20151211131415_add_site_to_spotlight_exhibits.rb
blacklight-spotlight-3.4.2 db/migrate/20151211131415_add_site_to_spotlight_exhibits.rb
blacklight-spotlight-3.4.1 db/migrate/20151211131415_add_site_to_spotlight_exhibits.rb
blacklight-spotlight-3.4.0 db/migrate/20151211131415_add_site_to_spotlight_exhibits.rb
blacklight-spotlight-3.3.0 db/migrate/20151211131415_add_site_to_spotlight_exhibits.rb
blacklight-spotlight-3.2.0 db/migrate/20151211131415_add_site_to_spotlight_exhibits.rb
blacklight-spotlight-3.1.0 db/migrate/20151211131415_add_site_to_spotlight_exhibits.rb