Class: MagicScopes::NumericScopesGenerator
Instance Method Summary
collapse
#gt, #lt
#by, #by_desc
#eq, #ne, #with, #without
#initialize, instance
Instance Method Details
#gte(name) ⇒ Object
8
9
10
|
# File 'lib/magic_scopes/scopes_generators/numeric.rb', line 8
def gte(name)
scope name || "#{@attr}_gte", ->(val) { where("#{@key} >= ?", val) }
end
|
#lte(name) ⇒ Object
12
13
14
|
# File 'lib/magic_scopes/scopes_generators/numeric.rb', line 12
def lte(name)
scope name || "#{@attr}_lte", ->(val) { where("#{@key} <= ?", val) }
end
|