From 7cca4c0e50f2521e44ae17771ddcfc5fe3a204bc Mon Sep 17 00:00:00 2001 From: Damian Legawiec Date: Tue, 1 Mar 2016 14:40:07 +0100 Subject: [PATCH] Add StateMachines::Machine.ignore_method_conflicts in initializer --- core/app/models/spree/order/checkout.rb | 2 -- core/lib/spree/core.rb | 4 ++++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/core/app/models/spree/order/checkout.rb b/core/app/models/spree/order/checkout.rb index 275dc337268..1303583b436 100644 --- a/core/app/models/spree/order/checkout.rb +++ b/core/app/models/spree/order/checkout.rb @@ -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) diff --git a/core/lib/spree/core.rb b/core/lib/spree/core.rb index 40ee546c4e2..efb6a76a8fc 100644 --- a/core/lib/spree/core.rb +++ b/core/lib/spree/core.rb @@ -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