Skip to content
Tags

,

Save or Save!

December 1, 2010

What is the difference between save and save! ?

Save! performs all validations and callbacks. If any validation returns false, save! throws an error and canceles the save.
Save does not throw any error in the case above, but canceles the save. Also, the validators can be bypassed.

Source: http://vladzloteanu.wordpress.com/2009/06/30/ruby-on-rails-interview-questions-part-2/

Advertisements

From → Uncategorized

Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: