Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Browse files

Correcting the documentation which wrongly states that each dynamic f…

…inder creates

method on the class. Only dynamic finders using <tt>scoped_by_*</tt> creates new
  • Loading branch information...
1 parent d3eacf9 commit db0e3e5ad1db9bc0204db1dbc4075180bce3bc93 @neerajdotname neerajdotname committed
Showing with 4 additions and 7 deletions.
  1. +4 −7 activerecord/lib/active_record/base.rb
11 activerecord/lib/active_record/base.rb
@@ -966,17 +966,14 @@ def compute_table_name
- # Enables dynamic finders like <tt>find_by_user_name(user_name)</tt> and
- # <tt>find_by_user_name_and_password(user_name, password)</tt> that are turned into
- # <tt>where(:user_name => user_name).first</tt> and
- # <tt>where(:user_name => user_name, :password => :password).first</tt>
- # respectively. Also works for <tt>all</tt> by using <tt>find_all_by_amount(50)</tt>
- # that is turned into <tt>where(:amount => 50).all</tt>.
+ # Enables dynamic finders like <tt>User.find_by_user_name(user_name)</tt> and
+ # <tt>User.scoped_by_user_name(user_name). Refer to Dynamic attribute-based finders
+ # section at the top of this file for more detailed information.
# It's even possible to use all the additional parameters to +find+. For example, the
# full interface for +find_all_by_amount+ is actually <tt>find_all_by_amount(amount, options)</tt>.
- # Each dynamic finder, scope or initializer/creator is also defined in the class after it
+ # Each dynamic finder using <tt>scoped_by_*</tt> is also defined in the class after it
# is first invoked, so that future attempts to use it do not run through method_missing.
def method_missing(method_id, *arguments, &block)
if match = DynamicFinderMatch.match(method_id)

0 comments on commit db0e3e5

Please sign in to comment.
Something went wrong with that request. Please try again.