Lazycoder

29Mar/060

Polymorphic relationships in Rails

Rails 1.1: RJS, Active Record++, respond_to, integration tests, and 500 other things!

RUBY:
  1. class Author <ActiveRecord::Base
  2.     has_many :authorships
  3.     has_many :books, :through => :authorships
  4.   end

That is beautiful.

Filed under: Rails No Comments