Permalink
Browse files

quoting 'and' to make it more distinct.

  • Loading branch information...
craigmonson committed Oct 12, 2011
1 parent 4a025f0 commit 532e6d59b50b241d51d2a423bab5962d9cf7b0d4
Showing with 1 addition and 1 deletion.
  1. +1 −1 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+.

0 comments on commit 532e6d5

Please sign in to comment.