diff options
Diffstat (limited to 'activerecord/lib/active_record')
4 files changed, 9 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/frontbase_adapter.rb b/activerecord/lib/active_record/connection_adapters/frontbase_adapter.rb index 7a6386bd7d..e25198fa0d 100644 --- a/activerecord/lib/active_record/connection_adapters/frontbase_adapter.rb +++ b/activerecord/lib/active_record/connection_adapters/frontbase_adapter.rb @@ -294,8 +294,10 @@ module ActiveRecord # Quotes the column value to help prevent # {SQL injection attacks}[http://en.wikipedia.org/wiki/SQL_injection]. def quote(value, column = nil) + return value.quoted_id if value.respond_to?(:quoted_id) + retvalue = "<INVALID>" - + puts "quote(#{value.inspect}(#{value.class}),#{column.type.inspect})" if FB_TRACE # If a column was passed in, use column type information unless value.nil? diff --git a/activerecord/lib/active_record/connection_adapters/oracle_adapter.rb b/activerecord/lib/active_record/connection_adapters/oracle_adapter.rb index fdfa887905..e4c9c411b3 100644 --- a/activerecord/lib/active_record/connection_adapters/oracle_adapter.rb +++ b/activerecord/lib/active_record/connection_adapters/oracle_adapter.rb @@ -214,6 +214,8 @@ begin end def quote(value, column = nil) #:nodoc: + return value.quoted_id if value.respond_to?(:quoted_id) + if column && [:text, :binary].include?(column.type) %Q{empty_#{ column.sql_type rescue 'blob' }()} else diff --git a/activerecord/lib/active_record/connection_adapters/sqlserver_adapter.rb b/activerecord/lib/active_record/connection_adapters/sqlserver_adapter.rb index f4913f72fd..658330cf53 100644 --- a/activerecord/lib/active_record/connection_adapters/sqlserver_adapter.rb +++ b/activerecord/lib/active_record/connection_adapters/sqlserver_adapter.rb @@ -333,6 +333,8 @@ module ActiveRecord end def quote(value, column = nil) + return value.quoted_id if value.respond_to?(:quoted_id) + case value when String if column && column.type == :binary && column.class.respond_to?(:string_to_binary) diff --git a/activerecord/lib/active_record/connection_adapters/sybase_adapter.rb b/activerecord/lib/active_record/connection_adapters/sybase_adapter.rb index 3272e6d598..e464fc56ad 100644 --- a/activerecord/lib/active_record/connection_adapters/sybase_adapter.rb +++ b/activerecord/lib/active_record/connection_adapters/sybase_adapter.rb @@ -273,6 +273,8 @@ module ActiveRecord end def quote(value, column = nil) + return value.quoted_id if value.respond_to?(:quoted_id) + case value when String if column && column.type == :binary && column.class.respond_to?(:string_to_binary) |