Skip to content

Commit 2c05beb

Browse files
committed
Bugfix: Do not interpolate empty array into SQL
This fixes an edge case, a taxon condition without any taxons defined. Prior to this commit, that would error on MySQL and Postgres.
1 parent 38d553f commit 2c05beb

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

promotions/app/models/concerns/solidus_promotions/conditions/taxon_condition.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ def taxon_ids_with_children
5252
end
5353

5454
def load_taxon_ids_with_children
55+
return [] unless taxon_ids.present?
56+
5557
aggregation_function = if ActiveRecord::Base.connection.adapter_name.downcase.match?(/postgres/)
5658
"string_agg(child.id::text, ',')"
5759
else

0 commit comments

Comments
 (0)