Module: MongoMapperExt::Tags::ClassMethods
- Defined in:
- lib/mongomapper_ext/tags.rb
Instance Method Summary collapse
- #find_tags(regex, conditions = {}, limit = 30) ⇒ Object
-
#find_with_tags(*tags) ⇒ Object
Model.find_with_tags(“budget”, “big”, :limit => 4).
- #tag_cloud(conditions = {}, limit = 30) ⇒ Object
Instance Method Details
#find_tags(regex, conditions = {}, limit = 30) ⇒ Object
22 23 24 |
# File 'lib/mongomapper_ext/tags.rb', line 22 def (regex, conditions = {}, limit = 30) self.database.eval("function(collection, a,b,c) { return find_tags(collection, a,b,c); }", self.collection_name, regex, conditions, limit) end |
#find_with_tags(*tags) ⇒ Object
Model.find_with_tags(“budget”, “big”, :limit => 4)
17 18 19 20 |
# File 'lib/mongomapper_ext/tags.rb', line 17 def (*) = . self.all(.merge(:tags => )) end |
#tag_cloud(conditions = {}, limit = 30) ⇒ Object
12 13 14 |
# File 'lib/mongomapper_ext/tags.rb', line 12 def tag_cloud(conditions = {}, limit = 30) self.database.eval("function(collection, q,l) { return tag_cloud(collection, q,l); }", self.collection_name, conditions, limit) end |