Using edge rails:
class User ActiveRecord::Base
has_many :locker_items
end
class LockerItem ActiveRecord::Base
belongs_to :user
belongs_to :item
end
class Item ActiveRecord::Base; end
user = User.find(1)
user.locker_items.count(:include = :item)
= SELECT count(*) AS count_all FROM
Rick Olson wrote:
On 8/8/06, Michael A. Schoen [EMAIL PROTECTED] wrote:
David Heinemeier Hansson wrote:
So...is this intentional? Would core be open to a patch that
allowed AR
to differentiate between nil -- this association needs to be loaded
and nil -- the target is actually nil?
Yes,
Jonathan Viney wrote:
I'd already mentioned this...
http://dev.rubyonrails.org/ticket/5767
-Jonathan.
Cool. Had a look on trac but didn't see the ticket.
Then again I have been up for 36hrs straight so I probably stared right
at it and still didn't see it!
--
Richard Livsey
http