Class: CreateCancanniblePermissions

Inherits:
Object
  • Object
show all
Defined in:
lib/generators/cancannible/templates/migration.rb

Instance Method Summary collapse

Instance Method Details

#changeObject



2
3
4
5
6
7
8
9
10
11
12
13
14
# File 'lib/generators/cancannible/templates/migration.rb', line 2

def change
  create_table :permissions, force: true do |table|
    table.integer  :permissible_id
    table.string   :permissible_type
    table.integer  :resource_id
    table.string   :resource_type
    table.string   :ability
    table.boolean  :asserted
    table.datetime :created_at
    table.datetime :updated_at
  end
  add_index :permissions, [:permissible_id, :permissible_type], name: "index_permissions_permissible"
end