From 74b7bfa6d2c5c777b11cb6ea8687c0461b579f7e Mon Sep 17 00:00:00 2001 From: Jeremy Kemper Date: Thu, 1 Jun 2006 02:04:35 +0000 Subject: Mind the order of things. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4393 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- .../lib/active_record/connection_adapters/frontbase_adapter.rb | 4 +++- activerecord/lib/active_record/connection_adapters/oracle_adapter.rb | 2 ++ .../lib/active_record/connection_adapters/sqlserver_adapter.rb | 2 ++ activerecord/lib/active_record/connection_adapters/sybase_adapter.rb | 2 ++ 4 files changed, 9 insertions(+), 1 deletion(-) (limited to 'activerecord/lib/active_record/connection_adapters') 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 = "" - + 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) -- cgit v1.2.3