Permalink
Browse files

Removed extra space from the array conditions section.

  • Loading branch information...
1 parent 08d81fd commit 3b2b77baaef3c8b9a8794f4c37916adf27a4d63e @radar radar committed Oct 31, 2008
Showing with 1 addition and 1 deletion.
  1. +1 −1 railties/doc/guides/source/finders.txt
@@ -134,7 +134,7 @@ If you'd like to add conditions to your find, you could just specify them in the
=== Array Conditions ===
- Now what if that number could vary, say as a parameter from somewhere, or perhaps from the user's level status somewhere? The find then becomes something like +Client.first(:conditions => ["orders_count = ?", params[:orders]])+. Active Record will go through the first element in the conditions value and any additional elements will replace the question marks (?) in the first element. If you want to specify two conditions, you can do it like +Client.first(:conditions => ["orders_count = ? AND locked = ?", params[:orders], false])+. In this example, the first question mark will be replaced with the value in params orders and the second will be replaced with true and this will find the first record in the table that has '2' as its value for the orders_count field and 'false' for its locked field.
+Now what if that number could vary, say as a parameter from somewhere, or perhaps from the user's level status somewhere? The find then becomes something like +Client.first(:conditions => ["orders_count = ?", params[:orders]])+. Active Record will go through the first element in the conditions value and any additional elements will replace the question marks (?) in the first element. If you want to specify two conditions, you can do it like +Client.first(:conditions => ["orders_count = ? AND locked = ?", params[:orders], false])+. In this example, the first question mark will be replaced with the value in params orders and the second will be replaced with true and this will find the first record in the table that has '2' as its value for the orders_count field and 'false' for its locked field.
The reason for doing code like:

0 comments on commit 3b2b77b

Please sign in to comment.