Sha256: 4aca961f327ddec091a915ebbcb7fdecc00a2f1c09722bba5f2fd934f61bdc04

Contents?: true

Size: 523 Bytes

Versions: 9

Compression:

Stored size: 523 Bytes

Contents

class ZuulPermissionCreate<%= table_name.camelize %> < ActiveRecord::Migration
  def change
    create_table(:<%= table_name %>) do |t|
<%= migration_data -%>

<% attributes.each do |attribute| -%>
      t.<%= attribute.type %> :<%= attribute.name %>
<% end -%>

      t.timestamps
    end

    add_index :<%= table_name %>, :slug
    add_index :<%= table_name %>, :context_type
    add_index :<%= table_name %>, :context_id
    add_index :<%= table_name %>, [:slug, :context_type, :context_id],  :unique => true
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
zuul-0.2.8 lib/generators/zuul/templates/permission.rb
zuul-0.2.7 lib/generators/zuul/templates/permission.rb
zuul-0.2.6 lib/generators/zuul/templates/permission.rb
zuul-0.2.5 lib/generators/zuul/templates/permission.rb
zuul-0.2.4 lib/generators/zuul/templates/permission.rb
zuul-0.2.3 lib/generators/zuul/templates/permission.rb
zuul-0.2.2 lib/generators/zuul/templates/permission.rb
zuul-0.2.1 lib/generators/zuul/templates/permission.rb
zuul-0.2.0 lib/generators/zuul/templates/permission.rb