Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove extra set_current_order calls (updated CHANGELOG and rebase) #2185

Merged
merged 1 commit into from
Aug 30, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
## Solidus 2.4.0 (master, unreleased)

- Remove `set_current_order` calls in `Spree::Core::ControllerHelpers::Order`
[\#2185](https://github.com/solidusio/solidus/pull/2185) ([Murph33](https://github.com/murph33))

Previously a before filter added in
`core/lib/spree/core/controller_helpers/order.rb` would cause SQL queries to
be used on almost every request in the frontend. If you do not use Solidus
Auth you will need to hook into this helper and call `set_current_order` where
your user signs in. This merges incomplete orders a user has going with their
current cart. If you do use Solidus Auth you will need to make sure you use a
current enough version (>= v1.5.0) that includes this explicit call. This
addresses [\#1116](https://github.com/solidusio/solidus/issues/1116).

- Remove `ffaker` as a runtime dependency in production [\#2140](https://github.com/solidusio/solidus/pull/2140) ([cbrunsdon](https://github.com/cbrunsdon))

- Invalidate existing non store credit payments during checkout [2075](https://github.com/solidusio/solidus/pull/2075) ([tvdeyen](https://github.com/tvdeyen))
Expand Down
3 changes: 0 additions & 3 deletions api/app/controllers/spree/api/checkouts_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@ class CheckoutsController < Spree::Api::BaseController
# TODO: Remove this after deprecated usage in #update is removed
include Spree::Core::ControllerHelpers::PaymentParameters

# This before_action comes from Spree::Core::ControllerHelpers::Order
skip_before_action :set_current_order

def next
authorize! :update, @order, order_token
if !expected_total_ok?(params[:expected_total])
Expand Down
2 changes: 0 additions & 2 deletions core/lib/spree/core/controller_helpers/order.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ module Order
include ControllerHelpers::Pricing

included do
before_action :set_current_order

helper_method :current_order
helper_method :simple_current_order
end
Expand Down
2 changes: 0 additions & 2 deletions frontend/app/controllers/spree/store_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ class StoreController < Spree::BaseController
include Spree::Core::ControllerHelpers::Pricing
include Spree::Core::ControllerHelpers::Order

skip_before_action :set_current_order, only: :cart_link

def unauthorized
render 'spree/shared/unauthorized', layout: Spree::Config[:layout], status: 401
end
Expand Down