mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
11060 - fix undefined method tax_category_options error in specs
This commit is contained in:
committed by
Rachel Arnould
parent
aad48b4670
commit
da34e7b780
@@ -24,7 +24,8 @@ module Admin
|
||||
elsif product_set.errors.present?
|
||||
@error_counts = { saved: product_set.saved_count, invalid: product_set.invalid.count }
|
||||
|
||||
render "index", status: :unprocessable_entity, locals: { producers:, categories:, flash: }
|
||||
render "index", status: :unprocessable_entity,
|
||||
locals: { producers:, categories:, tax_category_options:, flash: }
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -89,7 +89,7 @@ class ProductsReflex < ApplicationReflex
|
||||
html: render(partial: "admin/products_v3/content",
|
||||
locals: { products: @products, pagy: @pagy, search_term: @search_term,
|
||||
producer_options: producers, producer_id: @producer_id,
|
||||
category_options: categories, category_id: @category_id,
|
||||
category_options: categories, tax_category_options:, category_id: @category_id,
|
||||
flashes: flash })
|
||||
)
|
||||
|
||||
@@ -125,6 +125,10 @@ class ProductsReflex < ApplicationReflex
|
||||
Spree::Taxon.order(:name).map { |c| [c.name, c.id] }
|
||||
end
|
||||
|
||||
def tax_category_options
|
||||
Spree::TaxCategory.order(:name).pluck(:name, :id)
|
||||
end
|
||||
|
||||
def fetch_products
|
||||
product_query = OpenFoodNetwork::Permissions.new(current_user)
|
||||
.editable_products.merge(product_scope).ransack(ransack_query).result(distinct: true)
|
||||
|
||||
Reference in New Issue
Block a user