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.15 db/migrate/20110814070858_message_has_many_groups.rb
radiant-reader-extension-3.0.14 db/migrate/20110814070858_message_has_many_groups.rb
radiant-reader-extension-3.0.13 db/migrate/20110814070858_message_has_many_groups.rb
radiant-reader-extension-3.0.11 db/migrate/20110814070858_message_has_many_groups.rb
radiant-reader-extension-3.0.10 db/migrate/20110814070858_message_has_many_groups.rb
radiant-reader-extension-3.0.9 db/migrate/20110814070858_message_has_many_groups.rb
radiant-reader-extension-3.0.8 db/migrate/20110814070858_message_has_many_groups.rb
radiant-reader-extension-3.0.7 db/migrate/20110814070858_message_has_many_groups.rb
radiant-reader-extension-3.0.5 db/migrate/20110814070858_message_has_many_groups.rb
radiant-reader-extension-3.0.4 db/migrate/20110814070858_message_has_many_groups.rb
radiant-reader-extension-3.0.3 db/migrate/20110814070858_message_has_many_groups.rb
radiant-reader-extension-3.0.2 db/migrate/20110814070858_message_has_many_groups.rb
radiant-reader-extension-3.0.1 db/migrate/20110814070858_message_has_many_groups.rb
radiant-reader-extension-3.0.0 db/migrate/20110814070858_message_has_many_groups.rb