Skip to content

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