Module: CanTango::Adaptor::Mongo

Included in:
MongoMapper, Mongoid
Defined in:
lib/cantango/adaptor/mongo.rb

Instance Method Summary collapse

Instance Method Details

#attribute_condition(attribute, user_scope) ⇒ Object



9
10
11
# File 'lib/cantango/adaptor/mongo.rb', line 9

def attribute_condition attribute, user_scope
  { attribute.to_sym => candidate.send(attribute) }
end

#include_condition(attribute, candidate) ⇒ Object

include CanTango::daptor::Generic using #in on Hash (Mongoid query)



5
6
7
# File 'lib/cantango/adaptor/mongo.rb', line 5

def include_condition attribute, candidate
  { attribute.to_sym.in => candidate.send(attribute) }
end