From ab12e43d073dc574c74c89b532958ea57ce8ef25 Mon Sep 17 00:00:00 2001 From: Masood Ahmad <112746559+MSD118@users.noreply.github.com> Date: Tue, 27 Jan 2026 10:20:50 +0530 Subject: [PATCH 1/4] Fix case sensitivity in search fields and filter alias matching --- lib/query_helper.rb | 2 +- lib/query_helper/sql_filter.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/query_helper.rb b/lib/query_helper.rb index a973f2b..baf6a43 100644 --- a/lib/query_helper.rb +++ b/lib/query_helper.rb @@ -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.map(&:downcase).include? cm.alias_name.downcase placement = :having if cm.aggregate true else diff --git a/lib/query_helper/sql_filter.rb b/lib/query_helper/sql_filter.rb index 4838047..846b8bb 100644 --- a/lib/query_helper/sql_filter.rb +++ b/lib/query_helper/sql_filter.rb @@ -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 From 065b41b4e353137dfa0abc36b9083cc7e0bb0bd0 Mon Sep 17 00:00:00 2001 From: Masood Ahmad <112746559+MSD118@users.noreply.github.com> Date: Wed, 28 Jan 2026 12:29:18 +0530 Subject: [PATCH 2/4] fix case sensitivity in alias name matching for filters and search fields --- lib/query_helper.rb | 2 +- lib/query_helper/sql_filter.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/query_helper.rb b/lib/query_helper.rb index baf6a43..fd01ca6 100644 --- a/lib/query_helper.rb +++ b/lib/query_helper.rb @@ -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.map(&:downcase).include? cm.alias_name.downcase + if @search_fields.any? { |sf| sf.casecmp?(cm.alias_name) } placement = :having if cm.aggregate true else diff --git a/lib/query_helper/sql_filter.rb b/lib/query_helper/sql_filter.rb index 846b8bb..9448125 100644 --- a/lib/query_helper/sql_filter.rb +++ b/lib/query_helper/sql_filter.rb @@ -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.downcase == comparate_alias.downcase } + map = @column_maps.find { |m| m.alias_name.casecmp?(comparate_alias) } raise InvalidQueryError.new("cannot filter by #{comparate_alias}") unless map # create the filter From d70d4a49f6265374fcf9ccd4f2ec871d463fcf93 Mon Sep 17 00:00:00 2001 From: Masood Ahmad <112746559+MSD118@users.noreply.github.com> Date: Tue, 10 Feb 2026 18:53:49 +0530 Subject: [PATCH 3/4] bump version to 0.4.5 --- lib/query_helper/version.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/query_helper/version.rb b/lib/query_helper/version.rb index 88a3fde..c7606f3 100644 --- a/lib/query_helper/version.rb +++ b/lib/query_helper/version.rb @@ -1,3 +1,3 @@ class QueryHelper - VERSION = "0.4.4" + VERSION = "0.4.5" end From 32a8d887f83a44e40f2f711445d96936745852d4 Mon Sep 17 00:00:00 2001 From: Masood Ahmad <112746559+MSD118@users.noreply.github.com> Date: Mon, 16 Feb 2026 13:49:18 +0530 Subject: [PATCH 4/4] bump query_helper version to 0.4.5 --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index f972f31..f405ffc 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - query_helper (0.4.4) + query_helper (0.4.5) activerecord (> 5) activesupport (> 5) sqlite3