Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Creating scopes based on impressions #57

jeanlinux opened this Issue Nov 3, 2012 · 1 comment


None yet
3 participants

I don't know if this is right for the issues section but I've been trying to scope my model based on impressions (most viewed), i haven't been able to figure a way around, i i wish someone can help me figure this out or probably create a pull request for that.

You could create a scope with an anonymous function similar as it is descriped in this RailsGuide.

Just filter/sort there using Model.impressionist_count.
For extra performance gains use the counter cache

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment