On Nov 16, 2007, at 9:47 AM, Stefan Magnus Landrø wrote:

>> The REST APIs don't offer such a SELECT COUNT(*) idea, so
>> count is essentially the same as Person.find(:all).size.
>
> Well, IMHO the REST APIs ought to offer such an idea.
>
> Typically, I'd expect GET /persons/count.xml to return
> <count>47</count> or something similar

-1 over here.

Active Record wraps access to relational databases, Active Resource  
wraps access to RESTful web services. I expect them to provide a  
friendly abstraction for the underlying interface which is SQL and  
HTTP respectively. Counting does not belong to HTTP and in my view  
whether a resource "/collection/count" makes sense or not is  
application dependent, so I wouldn't put it in the API.

-- fxn


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Core" 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/rubyonrails-core?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to