Sha256: 03f49e6d5d340545feb775213a2336e7bb5c0010c489e945256e5c7d1687bcdf

Contents?: true

Size: 429 Bytes

Versions: 42

Compression:

Stored size: 429 Bytes

Contents

class MultipleOwnership < ActiveRecord::Migration
  def self.up
    rename_column :permissions, :page_id, :permitted_id
    add_column :permissions, :permitted_type, :string
    Permission.reset_column_information
    Permission.all.each {|p| p.update_attributes(:permitted_type => 'Page') }
  end

  def self.down
    rename_column :permissions, :permitted_id, :page_id
    remove_column :permissions, :permitted_type
  end
end

Version data entries

42 entries across 42 versions & 2 rubygems

Version Path
radiant-reader_group-extension-1.2.1 db/migrate/20110214101339_multiple_ownership.rb
radiant-reader_group-extension-1.2.0 db/migrate/20110214101339_multiple_ownership.rb