Browse files

stop using deprecated arel API

  • Loading branch information...
1 parent 869118a commit 85ffbfef9c0653cd04acb0d9156947bb6ac5b90e @tenderlove tenderlove committed Oct 12, 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,8 +291,8 @@ def find_one(id)
record = where(primary_key.eq(id)).first
unless record
- conditions = arel.wheres.map { |x| x.value }.join(', ')
- conditions = " [WHERE #{conditions}]" if conditions.present?
+ conditions = arel.where_sql
+ conditions = " [#{conditions}]" if conditions
raise RecordNotFound, "Couldn't find #{@klass.name} with ID=#{id}#{conditions}"
end

0 comments on commit 85ffbfe

Please sign in to comment.