mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Fix deprecation warning
This commit is contained in:
@@ -52,7 +52,7 @@ module Spree
|
||||
dependent: :destroy
|
||||
|
||||
has_many :variants, -> {
|
||||
where(is_master: false).order("#{::Spree::Variant.quoted_table_name}.position ASC")
|
||||
where(is_master: false).order("spree_variants.position ASC")
|
||||
}, class_name: 'Spree::Variant'
|
||||
|
||||
has_many :variants_including_master,
|
||||
|
||||
@@ -88,13 +88,13 @@ module Spree
|
||||
describe 'Variants sorting' do
|
||||
context 'without master variant' do
|
||||
it 'sorts variants by position' do
|
||||
expect(product.variants.to_sql).to match(/ORDER BY (\`|\")spree_variants(\`|\").position ASC/)
|
||||
expect(product.variants.to_sql).to match(/ORDER BY spree_variants.position ASC/)
|
||||
end
|
||||
end
|
||||
|
||||
context 'with master variant' do
|
||||
it 'sorts variants by position' do
|
||||
expect(product.variants_including_master.to_sql).to match(/ORDER BY (\`|\")spree_variants(\`|\").position ASC/)
|
||||
expect(product.variants_including_master.to_sql).to match(/ORDER BY spree_variants.position ASC/)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user