Class: Conditions::Exists
- Inherits:
-
FieldCondition
- Object
- Condition
- FieldCondition
- Conditions::Exists
- Defined in:
- lib/triggerable/conditions/field/exists.rb
Instance Method Summary collapse
Methods inherited from FieldCondition
Methods inherited from Condition
Constructor Details
This class inherits a constructor from Conditions::FieldCondition
Instance Method Details
#scope ⇒ Object
8 9 10 |
# File 'lib/triggerable/conditions/field/exists.rb', line 8 def scope "#{@field} IS #{'NOT ' if @value}NULL" end |
#true_for?(object) ⇒ Boolean
3 4 5 6 |
# File 'lib/triggerable/conditions/field/exists.rb', line 3 def true_for? object v = field_value(object) @value ? v.present? : v.blank? end |