From 365ede84467aa1f07230fb7d90689f106ddb86bc Mon Sep 17 00:00:00 2001 From: Martin Fenner Date: Mon, 3 Nov 2014 12:45:07 +0100 Subject: [PATCH] workaround for state_machine in Rails 4 https://github.com/pluginaweek/state_machine/issues/295 --- config/initializers/state_machine.rb | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 config/initializers/state_machine.rb diff --git a/config/initializers/state_machine.rb b/config/initializers/state_machine.rb new file mode 100644 index 000000000..6ee93418a --- /dev/null +++ b/config/initializers/state_machine.rb @@ -0,0 +1,14 @@ +# Rails 4.1.x and StateMachine don't play nice +# https://github.com/pluginaweek/state_machine/issues/295 + +require 'state_machine/version' + +unless StateMachine::VERSION == '1.2.0' + # If you see this message, please test removing this file + # If it's still required, please bump up the version above + Rails.logger.warn "Please remove me, StateMachine version has changed" +end + +module StateMachine::Integrations::ActiveModel + public :around_validation +end