Skip to content
Open
Show file tree
Hide file tree
Changes from all 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 Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
query_helper (0.3.6)
query_helper (0.3.7)
activerecord (> 5)
activesupport (> 5)
sqlite3
Expand Down
2 changes: 1 addition & 1 deletion lib/query_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ def search_filter(column_maps)
placement = :where
maps = column_maps.select do |cm|
placement = :having if cm.aggregate
@search_fields.include? cm.alias_name
@search_fields.map(&:downcase).include? cm.alias_name.downcase
end
bind_variable = ('a'..'z').to_a.shuffle[0,20].join.to_sym
@bind_variables[bind_variable] = "%#{@search_string}%"
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.downcase == comparate_alias.downcase }
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.3.6"
VERSION = "0.3.7"
end
Loading