File tree Expand file tree Collapse file tree
lib/state_machine/integrations Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -397,6 +397,11 @@ def reset(object)
397397 object . errors . clear if supports_validations?
398398 end
399399
400+ # Runs state events around the object's validation process
401+ def around_validation ( object )
402+ object . class . state_machines . transitions ( object , action , :after => false ) . perform { yield }
403+ end
404+
400405 protected
401406 # Whether observers are supported in the integration. Only true if
402407 # ActiveModel::Observer is available.
@@ -509,11 +514,6 @@ def define_validation_hook
509514 owner_class . set_callback ( :validation , :around , self , :prepend => true )
510515 end
511516
512- # Runs state events around the object's validation process
513- def around_validation ( object )
514- object . class . state_machines . transitions ( object , action , :after => false ) . perform { yield }
515- end
516-
517517 # Creates a new callback in the callback chain, always inserting it
518518 # before the default Observer callbacks that were created after
519519 # initialization.
You can’t perform that action at this time.
0 commit comments