diff options
Diffstat (limited to 'activerecord/lib/active_record/statement_cache.rb')
-rw-r--r-- | activerecord/lib/active_record/statement_cache.rb | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/statement_cache.rb b/activerecord/lib/active_record/statement_cache.rb index dd4ee0c4a0..3fadc38543 100644 --- a/activerecord/lib/active_record/statement_cache.rb +++ b/activerecord/lib/active_record/statement_cache.rb @@ -19,8 +19,12 @@ module ActiveRecord raise ArgumentError.new("Statement cannot be nil") if @relation.nil? end - def execute - @relation.dup.to_a + def execute(binds = nil) + rel = @relation.dup + if (binds != nil) + rel.replace_binds binds + end + rel.to_a end end end |