diff options
Diffstat (limited to 'activerecord')
-rw-r--r-- | activerecord/CHANGELOG | 2 | ||||
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/oracle_adapter.rb | 6 |
2 files changed, 5 insertions, 3 deletions
diff --git a/activerecord/CHANGELOG b/activerecord/CHANGELOG index 9028b7d875..602ab4e7c6 100644 --- a/activerecord/CHANGELOG +++ b/activerecord/CHANGELOG @@ -1,5 +1,7 @@ *SVN* +* Add Oracle support for CLOB inserts. Closes #4748. [schoenm@earthlink.net sandra.metz@duke.edu] + * Various fixes for sqlserver_adapter (odbc statement finishing, ado schema dumper, drop index). Closes #4831. [kajism@yahoo.com] * Add support for :order option to with_scope. Closes #3887. [eric.daspet@survol.net] 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 |