Class: CreateRolePermissions

Inherits:
Object
  • Object
show all
Defined in:
lib/generators/install/templates/create_role_permissions.rb

Instance Method Summary collapse

Instance Method Details

#changeObject



2
3
4
5
6
7
8
# File 'lib/generators/install/templates/create_role_permissions.rb', line 2

def change
    create_table :role_permissions do |t|
        t.references :role, index: true, foreign_key: {on_delete: :cascade}
        t.references :permission, index: true,  foreign_key: {on_delete: :cascade}
        t.timestamps
    end
end