Parent

Files

Class/Module Index [+]

Quicksearch

ActiveRecord::ConnectionAdapters::JdbcColumn

Attributes

limit[W]
precision[W]

Public Class Methods

column_types() click to toggle source
# File lib/arjdbc/jdbc/column.rb, line 27
def self.column_types
  # reset the column types if the # of constants changed since last call
  @column_types ||= begin 
    types = driver_constants.select { |c| c.respond_to? :column_selector }
    types.map! { |c| c.column_selector }
    types.inject({}) { |h, val| h[ val[0] ] = val[1]; h }
  end
end
driver_constants() click to toggle source
# File lib/arjdbc/jdbc/column.rb, line 36
def self.driver_constants
  reset_constants
  @driver_constants ||= ::ArJdbc.constants.map { |c| ::ArJdbc.const_get c }
end
new(config, name, default, *args) click to toggle source
# File lib/arjdbc/jdbc/column.rb, line 6
def initialize(config, name, default, *args)
  call_discovered_column_callbacks(config)
  super(name, default_value(default), *args)
  init_column(name, default, *args)
end
reset_constants() click to toggle source
# File lib/arjdbc/jdbc/column.rb, line 45
def self.reset_constants
  return false if ! defined?(@driver_constants) || ! @driver_constants
  reset_constants! if ::ArJdbc.constants.size != @driver_constants.size
end
reset_constants!() click to toggle source
# File lib/arjdbc/jdbc/column.rb, line 41
def self.reset_constants!
  @driver_constants = nil; @column_types = nil
end

Public Instance Methods

default_value(value) click to toggle source
# File lib/arjdbc/jdbc/column.rb, line 14
def default_value(value); value; end
init_column(*args) click to toggle source
# File lib/arjdbc/jdbc/column.rb, line 12
def init_column(*args); end

Protected Instance Methods

call_discovered_column_callbacks(config) click to toggle source
# File lib/arjdbc/jdbc/column.rb, line 18
def call_discovered_column_callbacks(config)
  dialect = (config[:dialect] || config[:driver]).to_s
  for matcher, block in self.class.column_types
    block.call(config, self) if matcher === dialect
  end
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.