Sha256: d68ed6d562dd228ee436e3f3ce84d81d9c8b56bd9c80fd690c37f8edd2daee4b

Contents?: true

Size: 1.07 KB

Versions: 8

Compression:

Stored size: 1.07 KB

Contents

class Create<%=parent_plural_class_name%> < ActiveRecord::Migration
  def self.up
    create_table :<%=parent_plural_name%> do |t|
      t.string :title
			t.string :filename
      t.text :desc
			t.boolean :active
			t.string :heading
			t.string :nav
			t.integer :position
      t.timestamps
    end
		
		AdminMenuItem.create({:title =>"<%=parent_plural_class_name%>", :controller_name => "<%=parent_plural_name%>", :url => "/<%=parent_plural_name%>"})
		MenuItem.create({:title => "All <%=parent_plural_class_name%>", :url => "/all/<%=parent_plural_name%>", :active => true})
		
		create_table :<%=child_plural_name%> do |t|
      t.string :title
      t.text :desc
      t.date :date_shot
      t.string :location
			t.integer :<%=parent_singular_name%>_id
			t.string 	:file_file_name
	    t.string 	:file_content_type
	    t.integer :file_file_size
	    t.datetime :file_updated_at
			t.integer :parent_id
			t.integer :lft
			t.integer :rgt
      t.timestamps
    end
		
  end
  
  def self.down
    drop_table :<%=parent_plural_name%>
		drop_table :<%=child_plural_name%>
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
dust-generators-0.2.8 rails_generators/dust_albums/templates/migration/albums_migration.rb
dust-generators-0.2.6 rails_generators/dust_albums/templates/migration/albums_migration.rb
dust-generators-0.2.5 rails_generators/dust_albums/templates/migration/albums_migration.rb
dust-generators-0.2.4 rails_generators/dust_albums/templates/migration/albums_migration.rb
dust-generators-0.2.3 rails_generators/dust_albums/templates/migration/albums_migration.rb
dust-generators-0.2.2 rails_generators/dust_albums/templates/migration/albums_migration.rb
dust-generators-0.2.1 rails_generators/dust_albums/templates/migration/albums_migration.rb
dust-generators-0.2.0 rails_generators/dust_albums/templates/migration/albums_migration.rb