aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib
diff options
context:
space:
mode:
Diffstat (limited to 'activerecord/lib')
-rw-r--r--activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb15
1 files changed, 8 insertions, 7 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb b/activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb
index ef4b45cd43..042bf49145 100644
--- a/activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb
+++ b/activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb
@@ -141,21 +141,22 @@ module ActiveRecord
end
class BindCollector < Arel::Collectors::Bind
- def initialize(conn)
- @conn = conn
- super()
+ def compile(bvs, conn)
+ super(bvs.map { |bv| conn.quote(*bv.reverse) })
end
+ end
- def compile(bvs)
- super(bvs.map { |bv| @conn.quote(*bv.reverse) })
+ class SQLString < Arel::Collectors::SQLString
+ def compile(bvs, conn)
+ super(bvs)
end
end
def collector
if @prepared_statements
- Arel::Collectors::SQLString.new
+ SQLString.new
else
- BindCollector.new self
+ BindCollector.new
end
end