When creating a new object, I get an ActiveRecord :: RecordNotSaved error on before_save.
But I want to get the correct message, other than the ActiveRecord :: RecordNotSaved error message.
How can I get the correct error message and pass it to help?
begin
raise unless object.save!
rescue ActiveRecord::RecordNotSaved => e
end
source
share