diff options
author | Craig Monson <craig@malachiarts.com> | 2011-10-12 10:34:27 -0400 |
---|---|---|
committer | Craig Monson <craig@malachiarts.com> | 2011-10-12 10:34:27 -0400 |
commit | 532e6d59b50b241d51d2a423bab5962d9cf7b0d4 (patch) | |
tree | 3b6f52590414ce4815d24cfc7f903ae3006ba25a /railties/guides | |
parent | 4a025f0080d05f6c27518a84cde0b93fa3821345 (diff) | |
download | rails-532e6d59b50b241d51d2a423bab5962d9cf7b0d4.tar.gz rails-532e6d59b50b241d51d2a423bab5962d9cf7b0d4.tar.bz2 rails-532e6d59b50b241d51d2a423bab5962d9cf7b0d4.zip |
quoting 'and' to make it more distinct.
Diffstat (limited to 'railties/guides')
-rw-r--r-- | railties/guides/source/active_record_querying.textile | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/railties/guides/source/active_record_querying.textile b/railties/guides/source/active_record_querying.textile index 6ac9197f44..2e1f89cb78 100644 --- a/railties/guides/source/active_record_querying.textile +++ b/railties/guides/source/active_record_querying.textile @@ -1024,7 +1024,7 @@ You can also use +find_last_by_*+ methods which will find the last record matchi You can specify an exclamation point (<tt>!</tt>) on the end of the dynamic finders to get them to raise an +ActiveRecord::RecordNotFound+ error if they do not return any records, like +Client.find_by_name!("Ryan")+ -If you want to find both by name and locked, you can chain these finders together by simply typing +and+ between the fields. For example, +Client.find_by_first_name_and_locked("Ryan", true)+. +If you want to find both by name and locked, you can chain these finders together by simply typing "+and+" between the fields. For example, +Client.find_by_first_name_and_locked("Ryan", true)+. WARNING: Up to and including Rails 3.1, when the number of arguments passed to a dynamic finder method is lesser than the number of fields, say <tt>Client.find_by_name_and_locked("Ryan")</tt>, the behavior is to pass +nil+ as the missing argument. This is *unintentional* and this behavior will be changed in Rails 3.2 to throw an +ArgumentError+. |