Skip to content

Commit

Permalink
Fixed problem with fuzzy matching in API queries.
Browse files Browse the repository at this point in the history
  • Loading branch information
gsrohde committed Aug 8, 2018
1 parent a0aa89c commit 9495bda
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/controllers/api/base_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ def fuzzy_match_restrictions(model_or_relation, where_params)
# remove these from where_params
where_params.delete_if { |k, v| fuzzy_params.has_key?(k) }

kv_pairs = fuzzy_params.to_unsafe_h.to_a
kv_pairs = fuzzy_params.to_a

where_clause_array = kv_pairs.map { |kv| "#{kv[0]}::text ~* ?" }
where_clause = where_clause_array.join(" AND ")
Expand Down

0 comments on commit 9495bda

Please sign in to comment.