> How would you do a active resource count, a la > > Person.count > > I can't see anything like that in the docs.
I don't think that really makes sense to have in ARes. In AR, it serves an important optimization requirement by allowing you to perform a SELECT COUNT(*) instead of pulling back all records from the database. The REST APIs don't offer such a SELECT COUNT(*) idea, so count is essentially the same as Person.find(:all).size. I think that's a more honest way to call and get that information. It'll lead you to think that it's probably a good idea to do: people = Person.find(:all) people.size # other actions on people We shouldn't pursue API parity with AR for the sake of it. They operate at very different scales and many practices are not directly transferable across those scales. So -1 from here. But it would good to have some documentation to explain why that is. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
