Skip to content

Commit

Permalink
Cleaned up the LOB writing code.
Browse files Browse the repository at this point in the history
  • Loading branch information
ivern committed Nov 10, 2008
1 parent 12c0384 commit c31abe8
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 12 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ test.*
doc
build.xml
nbproject
TAGS
*~
24 changes: 12 additions & 12 deletions lib/jdbc_adapter/jdbc_informix.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,19 @@ class Base
private
def write_lobs
if connection.is_a?(JdbcSpec::Informix)
self.class.columns.select do |c|
[:text, :binary].include? c.type
end.each do |c|
value = self[c.name]
value = value.to_yaml if unserializable_attribute?(c.name, c)
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)

unless value.nil? || (value == '')
connection.write_large_object(c.type == :binary,
c.name,
self.class.table_name,
self.class.primary_key,
quote_value(id),
value)
unless value.nil? || (value == '')
connection.write_large_object(c.type == :binary,
c.name,
self.class.table_name,
self.class.primary_key,
quote_value(id),
value)
end
end
end
end
Expand Down

0 comments on commit c31abe8

Please sign in to comment.