Exception Model Saving

Although there are many way’s to test whether or not your model has saved, this is a fool-proof way that I’ve come to love.

begin
  object.save!
rescue Record Invalid => error
  # failed
end
Posted on April 11, 2008 at 9:39 pm

No Responses »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a comment

(required)

(required)