Skip to content

Commit

Permalink
Fix Ruby3 incompatibility with keyword arguments in Rails save
Browse files Browse the repository at this point in the history
  • Loading branch information
mcclymont committed Apr 12, 2021
1 parent 8a3ba81 commit 8317803
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/state_machine/integrations/active_record.rb
Original file line number Diff line number Diff line change
Expand Up @@ -479,11 +479,11 @@ def initialize(*)
def define_action_hook
if action_hook == :save
define_helper :instance, <<-end_eval, __FILE__, __LINE__ + 1
def save(*)
def save(**)
self.class.state_machine(#{name.inspect}).send(:around_save, self) { super }
end
def save!(*)
def save!(**)
self.class.state_machine(#{name.inspect}).send(:around_save, self) { super } || raise(ActiveRecord::RecordInvalid.new(self))
end
Expand Down

0 comments on commit 8317803

Please sign in to comment.