Files

Class/Module Index [+]

Quicksearch

ArJdbc::Oracle::Column

Public Class Methods

guess_date_or_time(value) click to toggle source
# File lib/arjdbc/oracle/adapter.rb, line 96
def self.guess_date_or_time(value)
  return value if value.is_a? Date
  ( value && value.hour == 0 && value.min == 0 && value.sec == 0 ) ? 
    Date.new(value.year, value.month, value.day) : value
end
string_to_dummy_time(string) click to toggle source
# File lib/arjdbc/oracle/adapter.rb, line 92
def self.string_to_dummy_time(string)
  ::ActiveRecord::ConnectionAdapters::JdbcColumn.string_to_dummy_time(string)
end
string_to_time(string) click to toggle source
# File lib/arjdbc/oracle/adapter.rb, line 84
def self.string_to_time(string)
  return string unless string.is_a?(String)
  return nil if string.empty?
  return Time.now if string.index('CURRENT') == 0 # TODO seems very wrong
  
  ::ActiveRecord::ConnectionAdapters::JdbcColumn.string_to_time(string)
end

Public Instance Methods

extract_limit(sql_type) click to toggle source
# File lib/arjdbc/oracle/adapter.rb, line 58
def extract_limit(sql_type)
  case sql_type
  when /^(clob|date)/; nil
  else super
  end
end
primary=(val) click to toggle source
# File lib/arjdbc/oracle/adapter.rb, line 51
def primary=(val)
  super
  if val && @sql_type =~ /^NUMBER$/
    @type = :integer
  end
end
type_cast(value) click to toggle source
# File lib/arjdbc/oracle/adapter.rb, line 65
def type_cast(value)
  return nil if value.nil?
  case type
  when :datetime  then ArJdbc::Oracle::Column.string_to_time(value)
  when :timestamp then ArJdbc::Oracle::Column.string_to_time(value)
  else
    super
  end
end
type_cast_code(var_name) click to toggle source
# File lib/arjdbc/oracle/adapter.rb, line 75
def type_cast_code(var_name)
  case type
  when :datetime  then "ArJdbc::Oracle::Column.string_to_time(#{var_name})"
  when :timestamp then "ArJdbc::Oracle::Column.string_to_time(#{var_name})"
  else
    super
  end
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.