aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authorXavier Noria <fxn@hashref.com>2011-08-13 16:30:07 -0700
committerXavier Noria <fxn@hashref.com>2011-08-13 16:30:07 -0700
commitbf2b9d2de3f85e880e5afa980e6fd65b1f07557c (patch)
tree41545ddaa2ab78f4f70bd847be99550c8c52b4f8 /activerecord
parentacfdb18d92c3ab6b80023b643f89f3ce3cab6840 (diff)
parentf566fb32c49a81636ca341f376f99ef230d71d99 (diff)
downloadrails-bf2b9d2de3f85e880e5afa980e6fd65b1f07557c.tar.gz
rails-bf2b9d2de3f85e880e5afa980e6fd65b1f07557c.tar.bz2
rails-bf2b9d2de3f85e880e5afa980e6fd65b1f07557c.zip
Merge branch 'master' of github.com:lifo/docrails
Conflicts: RELEASING_RAILS.rdoc actionpack/lib/sprockets/railtie.rb actionpack/test/template/sprockets_helper_test.rb activerecord/test/cases/calculations_test.rb railties/guides/source/3_1_release_notes.textile railties/guides/source/active_resource_basics.textile railties/guides/source/command_line.textile
Diffstat (limited to 'activerecord')
-rw-r--r--activerecord/README.rdoc2
-rw-r--r--activerecord/lib/active_record/base.rb4
2 files changed, 5 insertions, 1 deletions
diff --git a/activerecord/README.rdoc b/activerecord/README.rdoc
index 8c5c544773..b5db57569c 100644
--- a/activerecord/README.rdoc
+++ b/activerecord/README.rdoc
@@ -197,7 +197,7 @@ Admit the Database:
== Download and installation
-The latest version of Active Record can be installed with Rubygems:
+The latest version of Active Record can be installed with RubyGems:
% [sudo] gem install activerecord
diff --git a/activerecord/lib/active_record/base.rb b/activerecord/lib/active_record/base.rb
index 0c5248c576..59977280b3 100644
--- a/activerecord/lib/active_record/base.rb
+++ b/activerecord/lib/active_record/base.rb
@@ -177,6 +177,10 @@ module ActiveRecord #:nodoc:
# And instead of writing <tt>Person.where(:last_name => last_name).all</tt>, you just do
# <tt>Person.find_all_by_last_name(last_name)</tt>.
#
+ # It's possible to add an exclamation point (!) on the end of the dynamic finders to get them to raise an
+ # <tt>ActiveRecord::RecordNotFound</tt> error if they do not return any records,
+ # like <tt>Person.find_by_last_name!</tt>.
+ #
# It's also possible to use multiple attributes in the same find by separating them with "_and_".
#
# Person.where(:user_name => user_name, :password => password).first