mirror of
https://github.com/aasm/aasm
synced 2023-03-27 23:22:41 -04:00
move .events to .aasm_events
This commit is contained in:
parent
7aae9e432d
commit
342984a3eb
1 changed files with 3 additions and 4 deletions
|
@ -27,17 +27,16 @@ module AASM
|
|||
|
||||
def event(name, &block)
|
||||
define_method("#{name.to_s}!") do
|
||||
new_state = self.class.events[name].fire(self)
|
||||
new_state = self.class.aasm_events[name].fire(self)
|
||||
self.aasm_current_state = new_state
|
||||
nil
|
||||
end
|
||||
|
||||
events[name] = AASM::SupportingClasses::Event.new(name, &block)
|
||||
aasm_events[name] = AASM::SupportingClasses::Event.new(name, &block)
|
||||
# Error if event defines no transitions?
|
||||
end
|
||||
|
||||
private
|
||||
def events
|
||||
def aasm_events
|
||||
@aasm_events ||= {}
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue