Module: IsFilterable::Filterable::SingletonMethods

Defined in:
lib/is_filterable/is_filterable.rb

Instance Method Summary collapse

Instance Method Details

#search(attribute, search) ⇒ Object



17
18
19
20
21
22
23
# File 'lib/is_filterable/is_filterable.rb', line 17

def search attribute, search
  if search
    where "#{attribute} LIKE ?", "%#{search}%"
  else
    scoped
  end
end