Created
March 27, 2012 21:04
-
-
Save benatkin/2220218 to your computer and use it in GitHub Desktop.
config/initializers/ibm_db_adapter_ext.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment