Skip to content

Commit

Permalink
Merge pull request jruby#167 from lexrupy/master
Browse files Browse the repository at this point in the history
Fix Support for Ar 3.2.1
  • Loading branch information
nicksieger committed Feb 7, 2012
2 parents 20ab7f2 + d2d68df commit 361ed15
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 4 deletions.
6 changes: 5 additions & 1 deletion lib/arjdbc/db2/adapter.rb
Expand Up @@ -8,7 +8,11 @@ def after_save_with_db2zos_blob
lobfields = self.class.columns.select { |c| c.sql_type =~ /blob|clob/i }
lobfields.each do |c|
value = self[c.name]
value = value.to_yaml if unserializable_attribute?(c.name, c)
if respond_to?(:unserializable_attribute?)
value = value.to_yaml if unserializable_attribute?(c.name, c)
else
value = value.to_yaml if value.is_a?(Hash)
end
next if value.nil?
connection.write_large_object(c.type == :binary, c.name, self.class.table_name, self.class.primary_key, quote_value(id), value)
end
Expand Down
6 changes: 5 additions & 1 deletion lib/arjdbc/firebird/adapter.rb
Expand Up @@ -7,7 +7,11 @@ def self.extended(mod)
def after_save_with_firebird_blob
self.class.columns.select { |c| c.sql_type =~ /blob/i }.each do |c|
value = self[c.name]
value = value.to_yaml if unserializable_attribute?(c.name, c)
if respond_to?(:unserializable_attribute?)
value = value.to_yaml if unserializable_attribute?(c.name, c)
else
value = value.to_yaml if value.is_a?(Hash)
end
next if value.nil?
connection.write_large_object(c.type == :binary, c.name, self.class.table_name, self.class.primary_key, quote_value(id), value)
end
Expand Down
6 changes: 5 additions & 1 deletion lib/arjdbc/informix/adapter.rb
Expand Up @@ -8,7 +8,11 @@ def write_lobs
self.class.columns.each do |c|
if [:text, :binary].include? c.type
value = self[c.name]
value = value.to_yaml if unserializable_attribute?(c.name, c)
if respond_to?(:unserializable_attribute?)
value = value.to_yaml if unserializable_attribute?(c.name, c)
else
value = value.to_yaml if value.is_a?(Hash)
end

unless value.nil? || (value == '')
connection.write_large_object(c.type == :binary,
Expand Down
6 changes: 5 additions & 1 deletion lib/arjdbc/oracle/adapter.rb
Expand Up @@ -10,7 +10,11 @@ def self.extended(mod)
def after_save_with_oracle_lob
self.class.columns.select { |c| c.sql_type =~ /LOB\(|LOB$/i }.each do |c|
value = self[c.name]
value = value.to_yaml if unserializable_attribute?(c.name, c)
if respond_to?(:unserializable_attribute?)
value = value.to_yaml if unserializable_attribute?(c.name, c)
else
value = value.to_yaml if value.is_a?(Hash)
end
next if value.nil? || (value == '')

connection.write_large_object(c.type == :binary, c.name, self.class.table_name, self.class.primary_key, quote_value(id), value)
Expand Down

0 comments on commit 361ed15

Please sign in to comment.