Module: CanTango::Rules::Adaptor::Generic

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

Instance Method Summary collapse

Instance Method Details

#attribute_condition(attribute, user_scope) ⇒ Object



6
7
8
# File 'lib/cantango/rules/adaptor/generic.rb', line 6

def attribute_condition attribute, user_scope
  Proc.new { |model| model.send(attribute) == user_scope }
end

#include_condition(attribute, user_scope) ⇒ Object



10
11
12
# File 'lib/cantango/rules/adaptor/generic.rb', line 10

def include_condition attribute, user_scope
  Proc.new { |model| model.send(attribute).include? user_scope }
end