pb_status_history = ProblemStatusHistory.new
pb_status_history.problem_id = @problem.id
end # end of transaction
puts 'error is '+$!
What I was trying to do above was to write a proper exception
handling for the above code.In Database table problem_status_id is an
integer field And I deliberatly wrote
@problem.update_attribute("problem_status_id",'ab') So what i expect was
an exception there and which will be caught by the raised as
and will be caught by rescue..But that did not happen.Could u please
tell me where the error is .Also in above I am using save! and put the
whole code in transaction block..So if suppose pb_status_history.save!
also results an exception need I to write another rescue for that also
or a single rescue do all these?
Thanks in advance