Namespace

Files

Class/Module Index [+]

Quicksearch

ArJdbc::Oracle::Column

@see ActiveRecord::ConnectionAdapters::JdbcColumn

Public Class Methods

included(base) click to toggle source
# File lib/arjdbc/oracle/column.rb, line 12
def self.included(base)
  # NOTE: assumes a standalone OracleColumn class
  class << base; include Cast; end
end

Public Instance Methods

primary=(value) click to toggle source
# File lib/arjdbc/oracle/column.rb, line 17
def primary=(value)
  super
  @type = :integer if value && @sql_type =~ /^NUMBER$/
end
type_cast(value) click to toggle source
# File lib/arjdbc/oracle/column.rb, line 22
def type_cast(value)
  return nil if value.nil?
  case type
  when :datetime  then self.class.string_to_time(value)
  when :timestamp then self.class.string_to_time(value)
  when :boolean   then self.class.value_to_boolean(value)
  else
    super
  end
end
type_cast_code(var_name) click to toggle source
# File lib/arjdbc/oracle/column.rb, line 33
def type_cast_code(var_name)
  case type
  when :datetime  then "#{self.class.name}.string_to_time(#{var_name})"
  when :timestamp then "#{self.class.name}.string_to_time(#{var_name})"
  when :boolean   then "#{self.class.name}.value_to_boolean(#{var_name})"
  else
    super
  end
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.