Permalink
Browse files

Document save/save! behavior explicitly if raise_on_save_failure is t…

…rue and the save fails
  • Loading branch information...
1 parent f7ed8c2 commit ccc23f47c0a0198c557906574d45bdaf0b8fdadd @jeremyevans committed Oct 8, 2008
Showing with 3 additions and 2 deletions.
  1. +3 −2 lib/sequel_model/record.rb
@@ -204,7 +204,8 @@ def refresh
# Creates or updates the record, after making sure the record
# is valid. If the record is not valid, or before_save,
# before_create (if new?), or before_update (if !new?) return
- # false, returns nil unless raise_on_save_failure is true.
+ # false, returns nil unless raise_on_save_failure is true (if it
+ # is true, it raises an error).
# Otherwise, returns self. You can provide an optional list of
# columns to update, in which case it only updates those columns.
def save(*columns)
@@ -217,7 +218,7 @@ def save(*columns)
# in which case it only updates those columns.
# If before_save, before_create (if new?), or before_update
# (if !new?) return false, returns nil unless raise_on_save_failure
- # is true. Otherwise, returns self.
+ # is true (if it is true, it raises an error). Otherwise, returns self.
def save!(*columns)
opts = columns.extract_options!
return save_failure(:save) if before_save == false

0 comments on commit ccc23f4

Please sign in to comment.