Method: IsFilterable::Filterable::SingletonMethods#search

Defined in:
lib/is_filterable/is_filterable.rb

#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