Skip to content
This repository has been archived by the owner on Apr 17, 2018. It is now read-only.

count method included in resource without dm-aggregates #6

Open
solnic opened this issue May 17, 2011 · 1 comment
Open

count method included in resource without dm-aggregates #6

solnic opened this issue May 17, 2011 · 1 comment

Comments

@solnic
Copy link
Contributor

solnic commented May 17, 2011

It's confusing that the count method is included on a resource without dm-aggregates being included. What's more confusing is it appears to return the proper count when no query hash is specified but otherwise will always return 0.


Created by Alex - 2010-08-10 17:09:31 UTC

Original Lighthouse ticket: http://datamapper.lighthouseapp.com/projects/20609/tickets/1384

@solnic
Copy link
Contributor Author

solnic commented May 17, 2011

I think #count is coming from Enumerable in 1.8.7+, but to avoid confusion we should probably use undef_method :count in Model and Collection.

We should probably also look at doing the same for :min, :max and other methods that are provided by dm-aggregates. I would’ve wished that we didn’t have knowledge of which dm-aggregates’ methods are in dm-core, since I think that screws up the dependency chain, but I don’t know if we can get around it.

by Dan Kubb (dkubb)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant