aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/relation.rb
diff options
context:
space:
mode:
authorNoemj <olli.rissanen@helsinki.fi>2013-05-15 17:20:23 +0300
committerNoemj <olli.rissanen@helsinki.fi>2013-05-15 17:20:23 +0300
commiteaf54865b1313094ffca16aca1b199394bc58bae (patch)
tree2a3aea0b1d4889ac8b7fcb2aeec2a572f13104a4 /activerecord/lib/active_record/relation.rb
parenta834b57b6e6028eebf6ec29c550f5328a527f487 (diff)
downloadrails-eaf54865b1313094ffca16aca1b199394bc58bae.tar.gz
rails-eaf54865b1313094ffca16aca1b199394bc58bae.tar.bz2
rails-eaf54865b1313094ffca16aca1b199394bc58bae.zip
Initial commit for select statements bindparam implementation
Diffstat (limited to 'activerecord/lib/active_record/relation.rb')
-rw-r--r--activerecord/lib/active_record/relation.rb16
1 files changed, 15 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/relation.rb b/activerecord/lib/active_record/relation.rb
index 56462d355b..4d4d299f44 100644
--- a/activerecord/lib/active_record/relation.rb
+++ b/activerecord/lib/active_record/relation.rb
@@ -188,7 +188,8 @@ module ActiveRecord
# Please see further details in the
# {Active Record Query Interface guide}[http://guides.rubyonrails.org/active_record_querying.html#running-explain].
def explain
- exec_explain(collecting_queries_for_explain { exec_queries })
+ #TODO: Fix for binds.
+ #exec_explain(collecting_queries_for_explain { exec_queries })
end
# Converts relation objects to Array.
@@ -552,6 +553,19 @@ module ActiveRecord
"#<#{self.class.name} [#{entries.join(', ')}]>"
end
+ def replace_binds(bind_values)
+ temp_binds = []
+ bind_values.map do |column, value|
+ case value
+ when String, Integer
+ if @klass.column_names.include? column.to_s
+ temp_binds.push([@klass.columns_hash[column.to_s], value])
+ end
+ end
+ end
+ self.bind_values = temp_binds
+ end
+
private
def exec_queries