From 315873809fb731d5df34baeed77777e8c356cdf7 Mon Sep 17 00:00:00 2001 From: Arthur CHAN Date: Fri, 12 Dec 2014 14:42:19 +0800 Subject: [PATCH 1/2] rails 4 around_validation protected --- lib/state_machine/integrations/active_model.rb | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/lib/state_machine/integrations/active_model.rb b/lib/state_machine/integrations/active_model.rb index db5368c3..8311767e 100644 --- a/lib/state_machine/integrations/active_model.rb +++ b/lib/state_machine/integrations/active_model.rb @@ -396,7 +396,13 @@ def errors_for(object) def reset(object) object.errors.clear if supports_validations? end - + + # Runs state events around the object's validation process + def around_validation(object) + object.class.state_machines.transitions(object, action, :after => false).perform { yield } + end + + protected # Whether observers are supported in the integration. Only true if # ActiveModel::Observer is available. @@ -509,11 +515,6 @@ def define_validation_hook owner_class.set_callback(:validation, :around, self, :prepend => true) end - # Runs state events around the object's validation process - def around_validation(object) - object.class.state_machines.transitions(object, action, :after => false).perform { yield } - end - # Creates a new callback in the callback chain, always inserting it # before the default Observer callbacks that were created after # initialization. From 3da3f55c3fcdb80f24ec40488fffabfbcb752ceb Mon Sep 17 00:00:00 2001 From: Arthur CHAN Date: Fri, 12 Dec 2014 14:45:03 +0800 Subject: [PATCH 2/2] update travis ci --- .travis.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 5f08979d..ca11a6e4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,9 +1,7 @@ language: ruby script: "bundle exec rake appraisal:integration test" rvm: - - 1.8.7 - - 1.9.2 - - 1.9.3 + - 2.1.1 - jruby-18mode - jruby-19mode - rbx-18mode