move .events to .aasm_events

This commit is contained in:
Scott Barron 2008-01-08 10:03:18 -05:00
parent 7aae9e432d
commit 342984a3eb
1 changed files with 3 additions and 4 deletions

View File

@ -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