Permalink
Browse files

do not pass AR objects to ARel

  • Loading branch information...
tenderlove committed Aug 4, 2010
1 parent 19c77a0 commit f316a851ddf3290ea4fda0fe4b1539bc9809b6ac
Showing with 2 additions and 0 deletions.
  1. +2 −0 activerecord/lib/active_record/relation/finder_methods.rb
@@ -286,6 +286,8 @@ def find_with_ids(*ids)
end
def find_one(id)
+ id = id.id if ActiveRecord::Base === id
+
record = where(primary_key.eq(id)).first
unless record

0 comments on commit f316a85

Please sign in to comment.