Module: MagicScopes::ComparisonScopes

Included in:
FloatScopesGenerator, NumericScopesGenerator
Defined in:
lib/magic_scopes/scopes_generators/mixins/comparison_scopes.rb

Instance Method Summary collapse

Instance Method Details

#gt(name) ⇒ Object



3
4
5
# File 'lib/magic_scopes/scopes_generators/mixins/comparison_scopes.rb', line 3

def gt(name)
  scope name || "#{@attr}_gt", ->(val){ where("#{@key} > ?", val) }
end

#lt(name) ⇒ Object



7
8
9
# File 'lib/magic_scopes/scopes_generators/mixins/comparison_scopes.rb', line 7

def lt(name)
  scope name || "#{@attr}_lt", ->(val){ where("#{@key} < ?", val) }
end