diff options
author | Xavier Noria <fxn@hashref.com> | 2011-08-13 16:30:07 -0700 |
---|---|---|
committer | Xavier Noria <fxn@hashref.com> | 2011-08-13 16:30:07 -0700 |
commit | bf2b9d2de3f85e880e5afa980e6fd65b1f07557c (patch) | |
tree | 41545ddaa2ab78f4f70bd847be99550c8c52b4f8 /activerecord/lib | |
parent | acfdb18d92c3ab6b80023b643f89f3ce3cab6840 (diff) | |
parent | f566fb32c49a81636ca341f376f99ef230d71d99 (diff) | |
download | rails-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/lib')
-rw-r--r-- | activerecord/lib/active_record/base.rb | 4 |
1 files changed, 4 insertions, 0 deletions
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 |