On 11 Oct 2009, at 21:55, Simon Harris wrote:

>> Is the real bug here that counting the children of a new resource is
>> an invalid request?
>
> If so, returning 0 would indeed make sense.

Possibly.  The only simple case is when all resources are saved.  But...

Case 1

   c = Category.new :name => "Food"
   c.posts << Post.new
   c.posts << Post.new
   c.posts << Post.new

   What is `c.posts.count` ?

Case 2

   c = Category.new :name => "Food"
   c.save
   c.posts << Post.new
   c.posts << Post.new
   c.posts << Post.new

   What is `c.posts.count` ?

Anything that involves a partially saved state gets messy...

-- 
http://www.patchspace.co.uk/
http://www.linkedin.com/in/ashleymoran
http://aviewfromafar.net/








--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"DataMapper" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/datamapper?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to