module ArJdbc::Firebird::Column

@see ActiveRecord::ConnectionAdapters::JdbcColumn

Public Instance Methods

default_value(value) click to toggle source
# File lib/arjdbc/firebird/adapter.rb, line 35
def default_value(value)
  return nil unless value
  if value =~ /^\s*DEFAULT\s+(.*)\s*$/i
    return $1 unless $1.upcase == 'NULL'
  end
end

Private Instance Methods

simplified_type(field_type) click to toggle source
Calls superclass method
# File lib/arjdbc/firebird/adapter.rb, line 44
def simplified_type(field_type)
  case field_type
  when /timestamp/i    then :datetime
  when /^smallint/i    then :integer
  when /^bigint|int/i  then :integer
  when /^double/i      then :float # double precision
  when /^decimal/i     then
    extract_scale(field_type) == 0 ? :integer : :decimal
  when /^char\(1\)$/i  then Firebird.emulate_booleans? ? :boolean : :string
  when /^char/i        then :string
  when /^blob\ssub_type\s(\d)/i
    return :binary if $1 == '0'
    return :text   if $1 == '1'
  else
    super
  end
end