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:
parent
a9eefa97dc
commit
24a4778ad4
2 changed files with 6 additions and 1 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue