Eager load distributors and cached_incoming_exchanges

This commit is contained in:
Nihal M. Kelanthodika
2022-01-31 22:41:35 +05:30
committed by Matt-Yorkley
parent f0d6cd1f59
commit 3152fef2ef
2 changed files with 8 additions and 4 deletions

View File

@@ -16,7 +16,7 @@ module Admin
respond_to do |format|
format.html do
if view_context.subscriptions_setup_complete?(@shops)
@order_cycles = OrderCycle.joins(:schedules).managed_by(spree_current_user)
@order_cycles = OrderCycle.joins(:schedules).managed_by(spree_current_user).includes([:distributors, :cached_incoming_exchanges])
@payment_methods = Spree::PaymentMethod.managed_by(spree_current_user).includes(:taggings)
@shipping_methods = Spree::ShippingMethod.managed_by(spree_current_user)
else
@@ -172,7 +172,7 @@ module Admin
includes(:taggings).
where(taggings: { taggable_type: "Spree::PaymentMethod",
taggable_id: Spree::PaymentMethod.from(Enterprise.managed_by(spree_current_user).
select('enterprises.id').find_by_id(params[:enterprise_id])),
select('enterprises.id').find_by(id: params[:enterprise_id])),
context: 'tags' })
payment_method_tags.each_with_object({}) do |tag, hash|

View File

@@ -9,8 +9,12 @@
"storybook": "start-storybook"
},
"jest": {
"testRegex": ["spec/javascripts/.*_test\\.js"],
"transformIgnorePatterns": ["/node_modules/(?!(stimulus)/)"]
"testRegex": [
"spec/javascripts/.*_test\\.js"
],
"transformIgnorePatterns": [
"/node_modules/(?!(stimulus)/)"
]
},
"devDependencies": {
"@storybook/addon-controls": "^6.4.13",