Skip to content
New issue

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

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support decorating Mongoid::Criteria #18

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

johanlindblad
Copy link

I have added support for decorating Mongoid::Criteria objects. I usually do @thing = Thing.all and the Mongoid::Criteria object that returns fails to get decorated when its passed to the view.

@johanlindblad
Copy link
Author

I was looking for some sort of a single method I could override to decorate whenever the Criteria returns model instances, which would have been a much prettier solution. Unfortunately I could find one, so I overrode the methods I normally use in my views. Maybe someone can find a better way.

@icortex
Copy link
Contributor

icortex commented Nov 27, 2013

+1 This is exactly what I was doing. Tested with Rails 4, Ruby 2 and Mongoid 4 (master branch). Thanks!

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

Successfully merging this pull request may close these issues.

2 participants