Module: CanTango::Rules::Adaptor::Mongo

Defined in:
lib/cantango/rules/adaptor/mongo.rb

Instance Method Summary collapse

Instance Method Details

#attribute_condition(attribute, user_scope) ⇒ Object



11
12
13
# File 'lib/cantango/rules/adaptor/mongo.rb', line 11

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

#include_condition(attribute, user_scope) ⇒ Object

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



7
8
9
# File 'lib/cantango/rules/adaptor/mongo.rb', line 7

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