From c5ee0ba6e2f130d89360af4ec10a5f48202f0f1e Mon Sep 17 00:00:00 2001 From: Eugene Kenny Date: Mon, 24 Feb 2020 00:03:53 +0000 Subject: [PATCH] Update some references to finder options [ci skip] Passing conditions to `find` was deprecated in Rails 4.0. --- activerecord/lib/active_record/errors.rb | 6 +++--- activerecord/lib/active_record/relation/finder_methods.rb | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/activerecord/lib/active_record/errors.rb b/activerecord/lib/active_record/errors.rb index 2de5829050..23c1f3735a 100644 --- a/activerecord/lib/active_record/errors.rb +++ b/activerecord/lib/active_record/errors.rb @@ -173,9 +173,9 @@ module ActiveRecord class RangeError < StatementInvalid end - # Raised when number of bind variables in statement given to +:condition+ key - # (for example, when using {ActiveRecord::Base.find}[rdoc-ref:FinderMethods#find] method) - # does not match number of expected values supplied. + # Raised when the number of placeholders in an SQL fragment passed to + # {ActiveRecord::Base.where}[rdoc-ref:QueryMethods#where] + # does not match the number of values supplied. # # For example, when there are two placeholders with only one value supplied: # diff --git a/activerecord/lib/active_record/relation/finder_methods.rb b/activerecord/lib/active_record/relation/finder_methods.rb index 4b312a2d38..5335db4b6f 100644 --- a/activerecord/lib/active_record/relation/finder_methods.rb +++ b/activerecord/lib/active_record/relation/finder_methods.rb @@ -284,9 +284,9 @@ module ActiveRecord # * Integer - Finds the record with this primary key. # * String - Finds the record with a primary key corresponding to this # string (such as '5'). - # * Array - Finds the record that matches these +find+-style conditions + # * Array - Finds the record that matches these +where+-style conditions # (such as ['name LIKE ?', "%#{query}%"]). - # * Hash - Finds the record that matches these +find+-style conditions + # * Hash - Finds the record that matches these +where+-style conditions # (such as {name: 'David'}). # * +false+ - Returns always +false+. # * No args - Returns +false+ if the relation is empty, +true+ otherwise.