aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/base.rb
diff options
context:
space:
mode:
authorMark Thomson <nzl216@gmail.com>2012-03-17 22:29:46 -0500
committerMark Thomson <nzl216@gmail.com>2012-03-17 22:29:46 -0500
commitf2bc404ba82431d32a35b4de15cb21f179bc24c7 (patch)
treeca58ce1118eeda244ced0ef0a1d94ed7ca38e5e0 /activerecord/lib/active_record/base.rb
parent98b4ef730696062b624c508d22ca76d9caa018cc (diff)
parent6ce54d4ba8c220a84e55e7dd798d364c3f48d9f7 (diff)
downloadrails-f2bc404ba82431d32a35b4de15cb21f179bc24c7.tar.gz
rails-f2bc404ba82431d32a35b4de15cb21f179bc24c7.tar.bz2
rails-f2bc404ba82431d32a35b4de15cb21f179bc24c7.zip
Merge remote-tracking branch 'origin/master'
Diffstat (limited to 'activerecord/lib/active_record/base.rb')
-rw-r--r--activerecord/lib/active_record/base.rb3
1 files changed, 3 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/base.rb b/activerecord/lib/active_record/base.rb
index d4d0220fb7..d25a821688 100644
--- a/activerecord/lib/active_record/base.rb
+++ b/activerecord/lib/active_record/base.rb
@@ -201,6 +201,9 @@ module ActiveRecord #:nodoc:
# # Now 'Bob' exist and is an 'admin'
# User.find_or_create_by_name('Bob', :age => 40) { |u| u.admin = true }
#
+ # Adding an exclamation point (!) on to the end of <tt>find_or_create_by_</tt> will
+ # raise an <tt>ActiveRecord::RecordInvalid</tt> error if the new record is invalid.
+ #
# Use the <tt>find_or_initialize_by_</tt> finder if you want to return a new record without
# saving it first. Protected attributes won't be set unless they are given in a block.
#