Sha256: cc9fab8e5ce5020f5fc21763e493de0ec83f7d6d8c28917e4912d9e0db379c4f

Contents?: true

Size: 525 Bytes

Versions: 17

Compression:

Stored size: 525 Bytes

Contents

class Create<%= plural_class_name %> < ActiveRecord::Migration
  def self.up
    create_table :<%= plural_name %> do |t|
    <%- for attribute in model_attributes -%>
      t.<%= attribute.type %> :<%= attribute.name %>
    <%- end -%>
    <%- unless options[:skip_timestamps] -%>
      t.timestamps
    <%- end -%>
    end
  end

	CmsMenuItem.create({:title =>"<%= plural_class_name %>", :controller_name => "<%= plural_name %>", :url => "/<%= plural_name %>"})

  def self.down
    drop_table :<%= plural_name %>
  end
end

Version data entries

17 entries across 16 versions & 1 rubygems

Version Path
dust-generators-0.2.4 lib/generators/dust/scaffold/templates/migration.rb
dust-generators-0.2.3 lib/generators/dust/scaffold/templates/migration.rb
dust-generators-0.2.2 lib/generators/dust/scaffold/templates/migration.rb
dust-generators-0.2.1 lib/generators/dust/scaffold/templates/migration.rb
dust-generators-0.2.0 lib/generators/dust/scaffold/templates/migration.rb
dust-generators-0.1.9 lib/generators/dust/scaffold/templates/migration.rb
dust-generators-0.1.8 lib/generators/dust/scaffold/templates/migration.rb
dust-generators-0.1.7 lib/generators/dust/scaffold/templates/migration.rb
dust-generators-0.1.6 lib/generators/dust/scaffold/templates/migration.rb
dust-generators-0.1.5 rails_generators/dust_scaffold/templates/migration.rb
dust-generators-0.1.5 lib/generators/dust/scaffold/templates/migration.rb
dust-generators-0.1.4 lib/generators/dust/scaffold/templates/migration.rb
dust-generators-0.1.3 lib/generators/dust/scaffold/templates/migration.rb
dust-generators-0.1.2 lib/generators/dust/scaffold/templates/migration.rb
dust-generators-0.1.1 lib/generators/dust/scaffold/templates/migration.rb
dust-generators-0.1.0 lib/generators/dust/scaffold/templates/migration.rb
dust-generators-0.0.3 lib/generators/dust/scaffold/templates/migration.rb