Files

Class/Module Index [+]

Quicksearch

ArJdbc::SQLite3::Column

Public Instance Methods

init_column(name, default, *args) click to toggle source

override {JdbcColumn#init_column}

# File lib/arjdbc/sqlite3/adapter.rb, line 18
def init_column(name, default, *args)
  if default =~ /NULL/
    @default = nil
  else
    super
  end
end
type_cast(value) click to toggle source

override {ActiveRecord::ConnectionAdapters::Column#type_cast}

# File lib/arjdbc/sqlite3/adapter.rb, line 27
def type_cast(value)
  return nil if value.nil?
  case type
  when :string then value
  when :primary_key 
    value.respond_to?(:to_i) ? value.to_i : ( value ? 1 : 0 )
  when :float    then value.to_f
  when :decimal  then self.class.value_to_decimal(value)
  when :boolean  then self.class.value_to_boolean(value)
  else super
  end
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.