Created
December 22, 2011 23:06
-
-
Save shaunr0b/1512247 to your computer and use it in GitHub Desktop.
A simple test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Search | |
include Mongoid::Document | |
field :query, :type => Hash | |
field :collection | |
embedded_in :user | |
def to_criteria | |
Mongoid::Criteria.new( collection.titleize.constantize ).fuse( query ) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment