Skip to content
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/query_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ def search_filter(column_maps)
raise ArgumentError.new("search_fields not defined") unless @search_fields.length > 0
placement = :where
maps = column_maps.select do |cm|
if @search_fields.include? cm.alias_name
if @search_fields.any? { |sf| sf.casecmp?(cm.alias_name) }
placement = :having if cm.aggregate
true
else
Expand Down
2 changes: 1 addition & 1 deletion lib/query_helper/sql_filter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def create_filters

@filter_values.each do |comparate_alias, criteria|
# Find the sql mapping if it exists
map = @column_maps.find { |m| m.alias_name == comparate_alias }
map = @column_maps.find { |m| m.alias_name.casecmp?(comparate_alias) }
raise InvalidQueryError.new("cannot filter by #{comparate_alias}") unless map

# create the filter
Expand Down
2 changes: 1 addition & 1 deletion lib/query_helper/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
class QueryHelper
VERSION = "0.4.4"
VERSION = "0.4.5"
end
Loading