RailsCasts Pro episodes are now free!
Learn more or hide this
GitHub User: jsuchal
Or even rails g migration add_profile_to_users profile:belongs_to{polymorphic}
rails g migration add_profile_to_users profile:belongs_to{polymorphic}
Nice refactoring.
Btw. when using generate migration you can use these advanced features (https://github.com/rails/rails/blob/master/railties/test/generators/model_generator_test.rb#L116-183) to create indexes, polymorphic associations, etc from command line without editing the migrations by hand afterwards.
Or even
rails g migration add_profile_to_users profile:belongs_to{polymorphic}
Nice refactoring.
Btw. when using generate migration you can use these advanced features (https://github.com/rails/rails/blob/master/railties/test/generators/model_generator_test.rb#L116-183) to create indexes, polymorphic associations, etc from command line without editing the migrations by hand afterwards.