mirror of
https://github.com/github/rails.git
synced 2026-04-26 03:00:59 -04:00
avoid passing AR::Base objects to Arel when we can
This commit is contained in:
@@ -169,6 +169,8 @@ module ActiveRecord
|
||||
# Person.exists?(['name LIKE ?', "%#{query}%"])
|
||||
# Person.exists?
|
||||
def exists?(id = nil)
|
||||
id = id.id if ActiveRecord::Base === id
|
||||
|
||||
case id
|
||||
when Array, Hash
|
||||
where(id).exists?
|
||||
|
||||
Reference in New Issue
Block a user