diff options
author | Marcel Molina <marcel@vernix.org> | 2006-04-26 20:43:29 +0000 |
---|---|---|
committer | Marcel Molina <marcel@vernix.org> | 2006-04-26 20:43:29 +0000 |
commit | 242cd0604e6a4fec691004beb950cf4261ba7f3c (patch) | |
tree | ef0153d7a7b0e8646501f939353ab9a01dc2db25 /activerecord/lib/active_record | |
parent | 8df0dad4aca911ed89b3a3ed412ae631ca377da9 (diff) | |
download | rails-242cd0604e6a4fec691004beb950cf4261ba7f3c.tar.gz rails-242cd0604e6a4fec691004beb950cf4261ba7f3c.tar.bz2 rails-242cd0604e6a4fec691004beb950cf4261ba7f3c.zip |
Add Oracle support for CLOB inserts. Closes #4748. [schoenm@earthlink.net sandra.metz@duke.edu]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4280 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/lib/active_record')
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/oracle_adapter.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/oracle_adapter.rb b/activerecord/lib/active_record/connection_adapters/oracle_adapter.rb index f12b02fca3..4165809648 100644 --- a/activerecord/lib/active_record/connection_adapters/oracle_adapter.rb +++ b/activerecord/lib/active_record/connection_adapters/oracle_adapter.rb @@ -58,11 +58,11 @@ begin after_save :write_lobs def write_lobs() #:nodoc: if connection.is_a?(ConnectionAdapters::OracleAdapter) - self.class.columns.select { |c| c.type == :binary }.each { |c| + self.class.columns.select { |c| c.sql_type =~ /LOB$/i }.each { |c| value = self[c.name] next if value.nil? || (value == '') lob = connection.select_one( - "SELECT #{ c.name} FROM #{ self.class.table_name } WHERE #{ self.class.primary_key} = #{quote(id)}", + "SELECT #{c.name} FROM #{self.class.table_name} WHERE #{self.class.primary_key} = #{quote(id)}", 'Writable Large Object')[c.name] lob.write value } @@ -210,7 +210,7 @@ begin end def quote(value, column = nil) #:nodoc: - if column && column.type == :binary + if column && column.sql_type =~ /LOB$/i %Q{empty_#{ column.sql_type rescue 'blob' }()} else case value |