From 3c11e92616c3934a2f82d7a570ea969877ec1a13 Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Wed, 11 Aug 2010 11:24:59 -0700 Subject: stop using private methods --- activerecord/lib/active_record/relation/finder_methods.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'activerecord/lib/active_record/relation') diff --git a/activerecord/lib/active_record/relation/finder_methods.rb b/activerecord/lib/active_record/relation/finder_methods.rb index b34c11973b..0c75acf723 100644 --- a/activerecord/lib/active_record/relation/finder_methods.rb +++ b/activerecord/lib/active_record/relation/finder_methods.rb @@ -291,7 +291,7 @@ module ActiveRecord 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 @@ module ActiveRecord 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 " -- cgit v1.2.3