From ad8275396ae6d76a6556e0f42d91e0a6dc42f4c8 Mon Sep 17 00:00:00 2001 From: Akira Matsuda Date: Wed, 2 Jan 2013 04:36:33 +0900 Subject: find_all_by is deprecated in AR 4 --- activerecord/lib/active_record/base.rb | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'activerecord') diff --git a/activerecord/lib/active_record/base.rb b/activerecord/lib/active_record/base.rb index 13424e621c..8285261e3e 100644 --- a/activerecord/lib/active_record/base.rb +++ b/activerecord/lib/active_record/base.rb @@ -162,12 +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 find_by_, find_last_by_, or find_all_by_ and thus produces finders - # like Person.find_by_user_name, Person.find_all_by_last_name, and - # Payment.find_by_transaction_id. Instead of writing + # to find_by_, or find_last_by_ and thus produces finders + # like Person.find_by_user_name, and # Payment.find_by_transaction_id. Instead of writing # Person.where(user_name: user_name).first, you just do Person.find_by_user_name(user_name). - # And instead of writing Person.where(last_name: last_name).all, you just do - # Person.find_all_by_last_name(last_name). # # It's possible to add an exclamation point (!) on the end of the dynamic finders to get them to raise an # ActiveRecord::RecordNotFound error if they do not return any records, @@ -180,7 +177,7 @@ module ActiveRecord #:nodoc: # # It's even possible to call these dynamic finder methods on relations and named scopes. # - # Payment.order("created_on").find_all_by_amount(50) + # 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. -- cgit v1.2.3