Sha256: c01b7e8acc9e0afa36a36c32a8ee171f2d184f3938b4a1c14ec6fbc2477497ea

Contents?: true

Size: 295 Bytes

Versions: 34

Compression:

Stored size: 295 Bytes

Contents

class MessageHasManyGroups < ActiveRecord::Migration
  def self.up
    Message.all.each do |m|
      if g = Group.find_by_id(m.group_id)
        m.permit(g)
      end
    end
    remove_column :messages, :group_id 
  end

  def self.down
    add_column :messages, :group_id , :integer
  end
end

Version data entries

34 entries across 34 versions & 1 rubygems

Version Path
radiant-reader-extension-3.0.38 db/migrate/20110814070858_message_has_many_groups.rb
radiant-reader-extension-3.0.37 db/migrate/20110814070858_message_has_many_groups.rb
radiant-reader-extension-3.0.36 db/migrate/20110814070858_message_has_many_groups.rb
radiant-reader-extension-3.0.35 db/migrate/20110814070858_message_has_many_groups.rb
radiant-reader-extension-3.0.33 db/migrate/20110814070858_message_has_many_groups.rb
radiant-reader-extension-3.0.32 db/migrate/20110814070858_message_has_many_groups.rb
radiant-reader-extension-3.0.31 db/migrate/20110814070858_message_has_many_groups.rb
radiant-reader-extension-3.0.30 db/migrate/20110814070858_message_has_many_groups.rb
radiant-reader-extension-3.0.29 db/migrate/20110814070858_message_has_many_groups.rb
radiant-reader-extension-3.0.28 db/migrate/20110814070858_message_has_many_groups.rb
radiant-reader-extension-3.0.27 db/migrate/20110814070858_message_has_many_groups.rb
radiant-reader-extension-3.0.26 db/migrate/20110814070858_message_has_many_groups.rb
radiant-reader-extension-3.0.25 db/migrate/20110814070858_message_has_many_groups.rb
radiant-reader-extension-3.0.24 db/migrate/20110814070858_message_has_many_groups.rb
radiant-reader-extension-3.0.23 db/migrate/20110814070858_message_has_many_groups.rb
radiant-reader-extension-3.0.20 db/migrate/20110814070858_message_has_many_groups.rb
radiant-reader-extension-3.0.19 db/migrate/20110814070858_message_has_many_groups.rb
radiant-reader-extension-3.0.18 db/migrate/20110814070858_message_has_many_groups.rb
radiant-reader-extension-3.0.17 db/migrate/20110814070858_message_has_many_groups.rb
radiant-reader-extension-3.0.16 db/migrate/20110814070858_message_has_many_groups.rb