1
0
Fork 0
mirror of https://github.com/aasm/aasm synced 2023-03-27 23:22:41 -04:00

fixed errors catching/raising

This commit is contained in:
Vladimir Meremyanin 2013-02-21 12:05:38 +04:00
parent a9eefa97dc
commit 24a4778ad4
2 changed files with 6 additions and 1 deletions

View file

@ -213,7 +213,7 @@ private
end
end
rescue StandardError => e
event.fire_callbacks(:error, self, e)
event.fire_callbacks(:error, self, e) || raise(e)
end
end
end

View file

@ -92,10 +92,15 @@ module AASM
case code
when Symbol, String
record.send(code, *args)
true
when Proc
record.instance_exec(*args, &code)
true
when Array
code.each {|a| invoke_callbacks(a, record, args)}
true
else
false
end
end