Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

avoid passing AR::Base objects to Arel when we can

  • Loading branch information...
commit 9269e55b1f2e605ebde6717403f275a415b34974 1 parent b46b5a6
@tenderlove tenderlove authored
Showing with 2 additions and 0 deletions.
  1. +2 −0  activerecord/lib/active_record/relation/finder_methods.rb
View
2  activerecord/lib/active_record/relation/finder_methods.rb
@@ -169,6 +169,8 @@ def all(*args)
# 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?
Please sign in to comment.
Something went wrong with that request. Please try again.