Permalink
Browse files

Merge pull request #44 from gilesbowkett/master

migration class name capitalization, readme cleanup
  • Loading branch information...
2 parents 625ba59 + 6ce1bd8 commit cf5dbde98fa764c8961bffb41264aaca164daaff @thuss committed Feb 21, 2012
Showing with 1 addition and 34 deletions.
  1. +0 −33 README.markdown
  2. +1 −1 lib/tasks/standalone_migrations.rb
View
33 README.markdown
@@ -53,8 +53,6 @@ Add database configuration to `db/config.yml` in your projects base directory e.
rake db:new_migration name=FooBarMigration
edit db/migrate/20081220234130_foo_bar_migration.rb
-... and fill in the up and down migrations [Cheatsheet](http://dizzy.co.uk/ruby_on_rails/cheatsheets/rails-migrations).
-
#### If you really want to, you can just execute raw SQL:
```ruby
@@ -67,37 +65,6 @@ def self.down
end
```
-#### Even better, you can use the _generate_ task to create the initial migration ####
-
-The general form is:
-
- rake db:generate model="model_name" fields="type:column_name0 type:column_name1 ... type:column_namen"
-
-You can have as many fields as you would like.
-
-An example to create a Person table with 3 columns (and it will automatically add the t.timestamps line)
-
- rake db:generate model="Person" fields="string:first_name string:last_name integer:age"
-
-This will create a migration in db/migrate/
-
-```ruby
-class CreatePerson < ActiveRecord::Migration
- def self.up
- create_table :Person do |t|
- t.string :first_name
- t.string :last_name
- t.integer :age
- t.timestamps
- end
- end
-
- def self.down
- drop_table :Person
- end
-end
-```
-
### To apply your newest migration:
rake db:migrate
View
2 lib/tasks/standalone_migrations.rb
@@ -99,6 +99,6 @@ def file_name migration
end
def class_name str
- str.split('_').map { |s| s.capitalize }.join
+ str.underscore.split('_').map { |s| s.capitalize }.join
end
end

0 comments on commit cf5dbde

Please sign in to comment.