Title: [774] trunk/activerecord-jdbc/lib/jdbc_adapter/jdbc_oracle.rb: Fix issue with oracle after save lob action doesn' t getting called correctly
Revision
774
Author
olabini
Date
2007-10-22 09:06:37 -0400 (Mon, 22 Oct 2007)

Log Message

Fix issue with oracle after save lob action doesn't getting called correctly

Modified Paths

Diff

Modified: trunk/activerecord-jdbc/lib/jdbc_adapter/jdbc_oracle.rb (773 => 774)


--- trunk/activerecord-jdbc/lib/jdbc_adapter/jdbc_oracle.rb	2007-10-17 15:20:11 UTC (rev 773)
+++ trunk/activerecord-jdbc/lib/jdbc_adapter/jdbc_oracle.rb	2007-10-22 13:06:37 UTC (rev 774)
@@ -1,8 +1,9 @@
 module ::ActiveRecord
   class Base
     # After setting large objects to empty, write data back with a helper method
-    after_save :write_lobs
-    def write_lobs() #:nodoc:
+    alias after_save_without_oracle_lob after_save
+    
+    def after_save_with_oracle_lob() #:nodoc:
       if connection.is_a?(JdbcSpec::Oracle)
         self.class.columns.select { |c| c.sql_type =~ /LOB\(|LOB$/i }.each { |c|
           value = self[c.name]
@@ -12,8 +13,10 @@
           connection.write_large_object(c.type == :binary, c.name, self.class.table_name, self.class.primary_key, quote_value(id), value)
         }
       end
+      after_save_without_oracle_lob
     end
-    private :write_lobs
+    
+    alias after_save after_save_with_oracle_lob
   end
 end
 
_______________________________________________
Jruby-extras-devel mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/jruby-extras-devel

Reply via email to