Skip to content

Commit

Permalink
Add StateMachines::Machine.ignore_method_conflicts in initializer
Browse files Browse the repository at this point in the history
  • Loading branch information
damianlegawiec authored and Mafi88 committed Mar 14, 2016
1 parent d9496a6 commit 7cca4c0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 0 additions & 2 deletions core/app/models/spree/order/checkout.rb
Expand Up @@ -38,8 +38,6 @@ def self.define_state_machine!

klass = self

# To avoid a ton of warnings when the state machine is re-defined
StateMachines::Machine.ignore_method_conflicts = true
# To avoid multiple occurrences of the same transition being defined
# On first definition, state_machines will not be defined
state_machines.clear if respond_to?(:state_machines)
Expand Down
4 changes: 4 additions & 0 deletions core/lib/spree/core.rb
Expand Up @@ -15,6 +15,10 @@
require 'responders'
require 'state_machines-activerecord'

# This is required because ActiveModel::Validations#invalid? conflicts with the
# invalid state of a Payment. In the future this should be removed.
StateMachines::Machine.ignore_method_conflicts = true

module Spree

mattr_accessor :user_class
Expand Down

0 comments on commit 7cca4c0

Please sign in to comment.