Skip to content

Commit

Permalink
Merge pull request #2185 from swcraig/update-and-rebase-pr-1137
Browse files Browse the repository at this point in the history
Remove extra set_current_order calls (updated CHANGELOG and rebase)
  • Loading branch information
gmacdougall authored Aug 30, 2017
2 parents 5d022c9 + a8cc071 commit 454d7c9
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 7 deletions.
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

0 comments on commit 454d7c9

Please sign in to comment.