Forum: Rails-core (closed, excessive spam) Add query attributes to associations

Posted by zilkey (Guest)
on 2008-06-03 06:50
(Received via mailing list)
I just added a patch to lighthouse that adds query attribute methods
to associations.  This makes associations behave more like any other
attribute -

class Post < ActiveRecord::Base
  has_many :comments
end

Post.new.comments? # => false

It adds query attribute methods to has_one (and through), has_many
(and through), belongs_to (works with polymorphic) and
has_and_belongs_to_many.

If that looks interesting / worthwhile, you can plus one it at:

http://rails.lighthouseapp.com/projects/8994/ticke...

Jeff Dean
This topic is locked and can not be replied to.