public
Created

config/initializers/ibm_db_adapter_ext.rb

  • Download Gist
ibm_db_adapter_ext.rb
Ruby
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
# ensure that database is loaded
ActiveRecord::Base.connection
 
module ActiveRecord
module ConnectionAdapters
class IBM_DBAdapter
def visitor
@visitor ||= Arel::Visitors::IBM_DB.new self
end
 
def to_sql(arel, binds = [])
if arel.respond_to?(:ast)
visitor.accept(arel.ast) do
quote(*binds.shift.reverse)
end
else
arel
end
end
end
end
end

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.