mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-14 23:47:48 +00:00
resolved conflict
This commit is contained in:
@@ -187,7 +187,8 @@ module Spree
|
||||
.with_permission(:add_to_order_cycle)
|
||||
.where(enterprises: { is_primary_producer: true })
|
||||
.pluck(:parent_id)
|
||||
where('spree_products.supplier_id IN (?)', [enterprise.id] | permitted_producer_ids)
|
||||
# where('spree_products.supplier_id IN (?)', [enterprise.id] | permitted_producer_ids)
|
||||
where(spree_products: { supplier_id: [enterprise.id] | permitted_producer_ids })
|
||||
}
|
||||
|
||||
scope :active, lambda { where(spree_products: { deleted_at: nil }) }
|
||||
|
||||
@@ -21,7 +21,7 @@ module Spree
|
||||
|
||||
belongs_to :zone, class_name: "Spree::Zone", inverse_of: :tax_rates
|
||||
belongs_to :tax_category, class_name: "Spree::TaxCategory", inverse_of: :tax_rates
|
||||
has_many :adjustments, as: :originator, inverse_of: :adjustments
|
||||
has_many :adjustments, as: :originator, dependent: true
|
||||
|
||||
validates :amount, presence: true, numericality: true
|
||||
validates :tax_category, presence: true
|
||||
|
||||
@@ -8,7 +8,7 @@ module Spree
|
||||
def add_class(name)
|
||||
instance_variable_set "@#{name}", Set.new
|
||||
|
||||
create_method( "#{name}=".to_sym ) { |val|
|
||||
create_method( :"#{name}=" ) { |val|
|
||||
instance_variable_set( "@" + name, val)
|
||||
}
|
||||
|
||||
|
||||
@@ -134,17 +134,17 @@ RSpec.describe "
|
||||
within "tr#v_#{variant.id}" do
|
||||
click_button 'Hide'
|
||||
end
|
||||
expect(page).to have_no_selector "tr#v_#{variant.id}"
|
||||
expect(page).not_to have_selector "tr#v_#{variant.id}"
|
||||
expect(page).to have_selector "tr#v_#{variant_related.id}"
|
||||
first("div#views-dropdown").click
|
||||
first("div#views-dropdown div.menu div.menu_item", text: "Hidden Products").click
|
||||
expect(page).to have_selector "tr#v_#{variant.id}"
|
||||
expect(page).to have_no_selector "tr#v_#{variant_related.id}"
|
||||
expect(page).not_to have_selector "tr#v_#{variant_related.id}"
|
||||
within "tr#v_#{variant.id}" do
|
||||
click_button 'Add'
|
||||
end
|
||||
expect(page).to have_no_selector "tr#v_#{variant.id}"
|
||||
expect(page).to have_no_selector "tr#v_#{variant_related.id}"
|
||||
expect(page).not_to have_selector "tr#v_#{variant.id}"
|
||||
expect(page).not_to have_selector "tr#v_#{variant_related.id}"
|
||||
first("div#views-dropdown").click
|
||||
first("div#views-dropdown div.menu div.menu_item", text: "Inventory Products").click
|
||||
expect(page).to have_selector "tr#v_#{variant.id}"
|
||||
@@ -502,8 +502,8 @@ RSpec.describe "
|
||||
within "table#new-products tr#v_#{variant2.id}" do
|
||||
click_button 'Hide'
|
||||
end
|
||||
expect(page).to have_no_selector "table#new-products tr#v_#{variant1.id}"
|
||||
expect(page).to have_no_selector "table#new-products tr#v_#{variant2.id}"
|
||||
expect(page).not_to have_selector "table#new-products tr#v_#{variant1.id}"
|
||||
expect(page).not_to have_selector "table#new-products tr#v_#{variant2.id}"
|
||||
click_button "Back to my inventory"
|
||||
|
||||
expect(page).to have_selector "table#variant-overrides tr#v_#{variant1.id}"
|
||||
|
||||
Reference in New Issue
Block a user