Permalink
Browse files

stop using private methods

  • Loading branch information...
1 parent e1b85c3 commit 8464ee065098ea7b6499775ef517ad1c4ba33029 @tenderlove tenderlove committed Aug 11, 2010
Showing with 2 additions and 2 deletions.
  1. +2 −2 activerecord/lib/active_record/relation/finder_methods.rb
View
4 activerecord/lib/active_record/relation/finder_methods.rb
@@ -291,7 +291,7 @@ def find_one(id)
record = where(primary_key.eq(id)).first
unless record
- conditions = arel.send(:where_clauses).join(', ')
+ conditions = arel.wheres.map { |x| x.value }.join(', ')
conditions = " [WHERE #{conditions}]" if conditions.present?
raise RecordNotFound, "Couldn't find #{@klass.name} with ID=#{id}#{conditions}"
end
@@ -317,7 +317,7 @@ def find_some(ids)
if result.size == expected_size
result
else
- conditions = arel.send(:where_clauses).join(', ')
+ conditions = arel.wheres.map { |x| x.value }.join(', ')
conditions = " [WHERE #{conditions}]" if conditions.present?
error = "Couldn't find all #{@klass.name.pluralize} with IDs "

0 comments on commit 8464ee0

Please sign in to comment.