Skip to content

Commit

Permalink
PG:: Fix Build where clause with nil arguments syntax error
Browse files Browse the repository at this point in the history
  • Loading branch information
maniSHarma7575 committed Aug 19, 2024
1 parent 16882b8 commit 53754ef
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion activerecord/lib/active_record/relation/query_methods.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1621,7 +1621,7 @@ def build_where_clause(opts, rest = []) # :nodoc:
parts = [Arel.sql(opts)]
elsif rest.first.is_a?(Hash) && /:\w+/.match?(opts)
parts = [build_named_bound_sql_literal(opts, rest.first)]
elsif opts.include?("?")
elsif opts.include?("?") && rest.compact.present?
parts = [build_bound_sql_literal(opts, rest)]
else
parts = [model.sanitize_sql(rest.empty? ? opts : [opts, *rest])]
Expand Down

0 comments on commit 53754ef

Please sign in to comment.