Module: JdbcSpec::Derby::Column

Defined in:
lib/jdbc_adapter/jdbc_derby.rb

Instance Method Summary collapse

Instance Method Details

#default_value(value) ⇒ Object

Post process default value from JDBC into a Rails-friendly format (columns-internal)



67
68
69
70
71
72
# File 'lib/jdbc_adapter/jdbc_derby.rb', line 67

def default_value(value)
  # jdbc returns column default strings with actual single quotes around the value.
  return $1 if value =~ /^'(.*)'$/

  value
end

#simplified_type(field_type) ⇒ Object



60
61
62
63
64
# File 'lib/jdbc_adapter/jdbc_derby.rb', line 60

def simplified_type(field_type)
  return :boolean if field_type =~ /smallint/i
  return :float if field_type =~ /real/i
  super
end