Sha256: b57f7bb83cf4dcce2bfebe4de0dc7b80cea5ad8c204a35475e333d3fd8d10e87
Contents?: true
Size: 700 Bytes
Versions: 11
Compression:
Stored size: 700 Bytes
Contents
class AddManyRolesStrategy < ActiveRecord::Migration class << self def up create_roles create_user_roles end def down drop_roles drop_user_roles end protected def create_user_roles create_table :<%= table_name.singularize %>_roles do |t| t.integer :<%= table_name.singularize %>_id t.integer :role_id t.timestamps end end def drop_user_roles drop_table :<%= table_name.singularize %>_roles end def create_roles create_table :roles do |t| t.string :name t.timestamps end end def drop_roles drop_table :roles end end end
Version data entries
11 entries across 11 versions & 1 rubygems