Skip to content

Commit

Permalink
Fix NoMethodError: protected method around_validation
Browse files Browse the repository at this point in the history
On Rails 4.2, state_machine is broken due to using `public_send` instead of a plain `send`. This patch is simply a formalized version of pluginaweek#348.
  • Loading branch information
francois authored Jun 14, 2017
1 parent 8a3ba81 commit 03f34af
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/state_machine/integrations/active_model.rb
Original file line number Diff line number Diff line change
Expand Up @@ -513,6 +513,7 @@ def define_validation_hook
def around_validation(object)
object.class.state_machines.transitions(object, action, :after => false).perform { yield }
end
public :around_validation

# Creates a new callback in the callback chain, always inserting it
# before the default Observer callbacks that were created after
Expand Down

0 comments on commit 03f34af

Please sign in to comment.