Skip to content

WebOnRails

Tag: migrations

Edge rails: Now create HABTM join tables easily using migration helper

Published on August 28, 2012

Earlier whenever we wanted to create a HABTM join table, we do this like: Now, in edge rails after this commit we can use a migration helper for the same:

Generating association while generating model

Published on December 14, 2008

May be you guys are already aware of, but in Rails 2.2 we can specify belongs_to association while generating model. So if we issue: We will get a Post model like: class Post < ActiveRecord::Base belongs_to :author end [/ruby] Also it will automatically add the foreign key column in the migration. [ruby] class CreatePosts < … Continue reading Generating association while generating model

Follow me on

Categories

Tags

ActiveRecord apache attachment_fu aws bash capistrano deploy edge rails elixir elixirlang Error Exception Exception Handelling full text search funday gems git hosting installation linux migrations mod_rewrite Notification pound Rails Rails4 rails_plugin rake ROR ruby rubygems Rubyonrails s3 SCP script server sftp STI Tips transfer Trick tricks ubuntu Ultrasphinx validations

© WebOnRails. Powered by WordPress & Krusze Theme.