Sha256: da142dafd7e31c7fe0d1234e745b71c6f8919db167b4cc692cecc11662680aee

Contents?: true

Size: 1.09 KB

Versions: 15

Compression:

Stored size: 1.09 KB

Contents

class Create<%= class_name %> < ActiveRecord::Migration

  def change
    create_table :<%= table_name %> do |t|
    <% unless localized? %><% attributes.each do |attribute| -%>
  t.<%= attr_db_type_wrapper(attribute)%> :<%= attr_db_name_wrapper(attribute) %>
    <% end -%> <% end %>
      t.string :slug
      t.string :previous_slug
      t.integer :position
      t.column :state , :string #use for publishing
      t.datetime :published_at
      <% unless localized? %>
      t.string :seo_title
      t.text :seo_keywords
      t.text :seo_description
      t.integer :fb_icon_id
      t.integer :parent_id
      t.integer :locale_id
      <%end%>
      t.timestamps
    end
    <% if localized? %>
    create_table :<%= singular_name %>_localizations do |t|
  <% attributes.each do |attribute| -%>
    t.<%= attr_db_type_wrapper(attribute)%> :<%= attr_db_name_wrapper(attribute) %>
  <% end -%>
    t.string :seo_title
      t.text :seo_keywords
      t.text :seo_description
      t.integer :fb_icon_id
      t.integer :parent_id
      t.integer :locale_id
      t.timestamps
    end
    <% end %>
  end

end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
gluttonberg-core-2.6.4 lib/generators/gluttonberg/resource/templates/migration.rb
gluttonberg-core-2.6.3 lib/generators/gluttonberg/resource/templates/migration.rb
gluttonberg-core-2.6.2 lib/generators/gluttonberg/resource/templates/migration.rb
gluttonberg-core-2.6.1 lib/generators/gluttonberg/resource/templates/migration.rb
gluttonberg-core-2.6.0 lib/generators/gluttonberg/resource/templates/migration.rb
gluttonberg-core-2.5.9 lib/generators/gluttonberg/resource/templates/migration.rb
gluttonberg-core-2.5.8 lib/generators/gluttonberg/resource/templates/migration.rb
gluttonberg-core-2.5.7 lib/generators/gluttonberg/resource/templates/migration.rb
gluttonberg-core-2.5.6 lib/generators/gluttonberg/resource/templates/migration.rb
gluttonberg-core-2.5.5 lib/generators/gluttonberg/resource/templates/migration.rb
gluttonberg-core-2.5.4 lib/generators/gluttonberg/resource/templates/migration.rb
gluttonberg-core-2.5.3 lib/generators/gluttonberg/resource/templates/migration.rb
gluttonberg-core-2.5.2 lib/generators/gluttonberg/resource/templates/migration.rb
gluttonberg-core-2.5.1 lib/generators/gluttonberg/resource/templates/migration.rb
gluttonberg-core-2.5 lib/generators/gluttonberg/resource/templates/migration.rb