Module: ArJdbc::Derby::Column

Defined in:
lib/arjdbc/derby/adapter.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)



46
47
48
49
50
51
# File 'lib/arjdbc/derby/adapter.rb', line 46

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



39
40
41
42
43
# File 'lib/arjdbc/derby/adapter.rb', line 39

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