class SimpleFilter::Base
Attributes
params[R]
scope[R]
Public Class Methods
new(params = {}, scope = nil)
click to toggle source
# File lib/simple_filter/base.rb, line 7 def initialize(params = {}, scope = nil) @params = params @scope = scope end
Public Instance Methods
scoping(scope)
click to toggle source
# File lib/simple_filter/base.rb, line 12 def scoping(scope) @scope = scope self end
search()
click to toggle source
# File lib/simple_filter/base.rb, line 18 def search conditions.scope end
Private Instance Methods
conditions()
click to toggle source
# File lib/simple_filter/base.rb, line 24 def conditions self.class.filters.each do |filter| @scope.merge! send(filter) || @scope.where(nil) end self end