1
0
Fork 0
mirror of https://github.com/aasm/aasm synced 2023-03-27 23:22:41 -04:00
aasm/spec/models/event_with_keyword_arguments.rb
pocari 018c3a9ec9
Fixed an error in Ruby 3 when specifying a method that takes keyword arguments, such as event's before hook. (#777)
* Reproduction case added

* Allow keyword arguments to be passed to event before, etc. in Ruby 2.7.1 and above.

* refactoring
2022-04-14 23:31:56 +05:30

16 lines
273 B
Ruby

class EventWithKeywordArguments
include AASM
aasm do
state :open, :initial => true, :column => :status
state :closed
event :close do
before :_before_close
transitions from: :open, to: :closed
end
end
def _before_close(key:)
end
end