Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Added that script/generate model will now automatically create a migr…
…ation file for the model created. This can be turned off by calling the generator with --skip-migration [DHH] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3644 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
- Loading branch information
Showing
4 changed files
with
32 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
railties/lib/rails_generator/generators/components/model/templates/migration.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
class <%= migration_name %> < ActiveRecord::Migration | ||
def self.up | ||
create_table "<%= table_name %>" do |t| | ||
# t.column "name", :string | ||
end | ||
end | ||
def self.down | ||
drop_table "<%= table_name %>" | ||
end | ||
end |