Skip to content

Commit

Permalink
Fix in_taxons scope when taxon is an ActiveRecord::Base
Browse files Browse the repository at this point in the history
The variable has been missed in solidusio#3400
  • Loading branch information
kennyadsl committed May 11, 2020
1 parent 354e249 commit 3b35196
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core/app/models/spree/product/scopes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ def get_taxons(*ids_or_records_or_names)
ids_or_records_or_names.flatten.map { |taxon|
case taxon
when Integer then Spree::Taxon.find_by(id: taxon)
when ActiveRecord::Base then t
when ActiveRecord::Base then taxon
when String
Spree::Taxon.find_by(name: taxon) ||
Spree::Taxon.where("#{taxons}.permalink LIKE ? OR #{taxons}.permalink = ?", "%/#{taxon}/", "#{taxon}/").first
Expand Down

0 comments on commit 3b35196

Please sign in to comment.