Sha256: 16c4cc8e1cc6c84f8b9c0b0045c6129cb41a097b5d425360862424724032f565

Contents?: true

Size: 507 Bytes

Versions: 2

Compression:

Stored size: 507 Bytes

Contents

class IAmICanCreate<%= "#{name.underscore}_permissions".camelize %> < ActiveRecord::Migration::Current
  def change
    create_table :<%= "#{name.underscore}_permissions" %>, force: :cascade do |t|
      t.string  :pred,     null: false
      t.string  :obj_type
      t.integer :obj_id
      t.string  :desc

      t.timestamps
    end

    add_index :<%= "#{name.underscore}_permissions" %>, %i[pred obj_type obj_id],
                unique: true, name: 'permission_unique_index', using: :btree
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
i_am_i_can-3.0.0pre lib/generators/i_am_i_can/templates/migrations/permission.erb
i_am_i_can-2.1.0 lib/generators/i_am_i_can/templates/migrations/permission.erb