diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2012-02-27 10:57:40 -0800 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2012-02-27 11:13:56 -0800 |
commit | 4bc2ae0da1dd812aee759f6d13ad428354cd0e13 (patch) | |
tree | ab5609062d04dc1ba43b1449c9f3009356b6cea7 /activerecord/lib/active_record/relation/finder_methods.rb | |
parent | a4e4d2855bbad1c1400fb89ba663f7193d76dc10 (diff) | |
download | rails-4bc2ae0da1dd812aee759f6d13ad428354cd0e13.tar.gz rails-4bc2ae0da1dd812aee759f6d13ad428354cd0e13.tar.bz2 rails-4bc2ae0da1dd812aee759f6d13ad428354cd0e13.zip |
use bind values for join columns
Diffstat (limited to 'activerecord/lib/active_record/relation/finder_methods.rb')
-rw-r--r-- | activerecord/lib/active_record/relation/finder_methods.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/relation/finder_methods.rb b/activerecord/lib/active_record/relation/finder_methods.rb index 26a5165abf..4cd703e0a5 100644 --- a/activerecord/lib/active_record/relation/finder_methods.rb +++ b/activerecord/lib/active_record/relation/finder_methods.rb @@ -200,7 +200,7 @@ module ActiveRecord relation = relation.where(table[primary_key].eq(id)) if id end - connection.select_value(relation, "#{name} Exists") ? true : false + connection.select_value(relation, "#{name} Exists", relation.bind_values) ? true : false end protected @@ -331,7 +331,7 @@ module ActiveRecord substitute = connection.substitute_at(column, @bind_values.length) relation = where(table[primary_key].eq(substitute)) - relation.bind_values = [[column, id]] + relation.bind_values += [[column, id]] record = relation.first unless record |