Flowdock

Notes posted by rojotek

RSS feed
February 25, 2014
1 thank

missing :through option

So the way to do the equivalent of a has_many :through is to use has_one :through, with the expected names.

so using the other example we could do

eg

class Person < ActiveRecord::Base
  belongs_to :team
  ...
end
class Task < ActiveRecord::Base
  belongs_to :person
  has_one :team, :through => :person
end