lib/administrate/search.rb in administrate-0.1.0 vs lib/administrate/search.rb in administrate-0.1.1
- old
+ new
@@ -16,14 +16,14 @@
private
delegate :resource_class, to: :resolver
def query
- search_attributes.map { |attr| "#{attr} ILIKE ?" }.join(" OR ")
+ search_attributes.map { |attr| "lower(#{attr}) LIKE ?" }.join(" OR ")
end
def search_terms
- ["%#{term}%"] * search_attributes.count
+ ["%#{term.downcase}%"] * search_attributes.count
end
def search_attributes
resolver.dashboard_class::ATTRIBUTE_TYPES.select do |_, type|
type.searchable?