RailsCasts Pro episodes are now free!

Learn more or hide this

Ján Suchal's Profile

GitHub User: jsuchal

Comments by Ján Suchal

Avatar

Or even rails g migration add_profile_to_users profile:belongs_to{polymorphic}

Avatar

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.