diff options
author | Akira Matsuda <ronnie@dio.jp> | 2013-01-02 04:42:47 +0900 |
---|---|---|
committer | Akira Matsuda <ronnie@dio.jp> | 2013-01-02 04:47:29 +0900 |
commit | 44717a9d548c95c7b01e7e0dce061257b3a93646 (patch) | |
tree | 89d31644f3eb7571d299524f432bac4e469e1042 /activerecord | |
parent | ad8275396ae6d76a6556e0f42d91e0a6dc42f4c8 (diff) | |
download | rails-44717a9d548c95c7b01e7e0dce061257b3a93646.tar.gz rails-44717a9d548c95c7b01e7e0dce061257b3a93646.tar.bz2 rails-44717a9d548c95c7b01e7e0dce061257b3a93646.zip |
find_last_by is deprecated in AR 4
Diffstat (limited to 'activerecord')
-rw-r--r-- | activerecord/lib/active_record/base.rb | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/activerecord/lib/active_record/base.rb b/activerecord/lib/active_record/base.rb index 8285261e3e..3d374fe9b4 100644 --- a/activerecord/lib/active_record/base.rb +++ b/activerecord/lib/active_record/base.rb @@ -162,9 +162,9 @@ module ActiveRecord #:nodoc: # # Dynamic attribute-based finders are a cleaner way of getting (and/or creating) objects # by simple queries without turning to SQL. They work by appending the name of an attribute - # to <tt>find_by_</tt>, or <tt>find_last_by_</tt> and thus produces finders - # like <tt>Person.find_by_user_name</tt>, and # <tt>Payment.find_by_transaction_id</tt>. Instead of writing - # <tt>Person.where(user_name: user_name).first</tt>, you just do <tt>Person.find_by_user_name(user_name)</tt>. + # to <tt>find_by_</tt> # like <tt>Person.find_by_user_name</tt>. + # Instead of writing # <tt>Person.where(user_name: user_name).first</tt>, you just do + # <tt>Person.find_by_user_name(user_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, @@ -178,7 +178,6 @@ module ActiveRecord #:nodoc: # It's even possible to call these dynamic finder methods on relations and named scopes. # # Payment.order("created_on").find_by_amount(50) - # Payment.pending.find_last_by_amount(100) # # The same dynamic finder style can be used to create the object if it doesn't already exist. # This dynamic finder is called with <tt>find_or_create_by_</tt> and will return the object if |