Class: ActiveRecord::ConnectionAdapters::MysqlAdapter::Column

Inherits:
AbstractMysqlAdapter::Column show all
Defined in:
lib/active_record/connection_adapters/mysql_adapter.rb

Overview

:nodoc:

Constant Summary

Constants inherited from Column

Column::FALSE_VALUES, Column::TRUE_VALUES

Instance Attribute Summary

Attributes inherited from AbstractMysqlAdapter::Column

#collation, #extra, #strict

Attributes inherited from Column

#coder, #default, #default_function, #limit, #name, #null, #precision, #primary, #scale, #sql_type, #type

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from AbstractMysqlAdapter::Column

#blob_or_text_column?, #case_sensitive?, #extract_default, #has_default?, #initialize

Methods inherited from Column

#binary?, binary_to_string, #extract_default, #has_default?, #human_name, #initialize, #klass, #number?, #text?, #type_cast, #type_cast_for_write, value_to_boolean, value_to_date, value_to_decimal, value_to_integer

Constructor Details

This class inherits a constructor from ActiveRecord::ConnectionAdapters::AbstractMysqlAdapter::Column

Class Method Details

.string_to_date(v) ⇒ Object



88
89
90
91
# File 'lib/active_record/connection_adapters/mysql_adapter.rb', line 88

def self.string_to_date(v)
  return super unless Mysql::Time === v
  new_date(v.year, v.month, v.day)
end

.string_to_dummy_time(v) ⇒ Object



83
84
85
86
# File 'lib/active_record/connection_adapters/mysql_adapter.rb', line 83

def self.string_to_dummy_time(v)
  return super unless Mysql::Time === v
  new_time(2000, 01, 01, v.hour, v.minute, v.second, v.second_part)
end

.string_to_time(value) ⇒ Object



71
72
73
74
75
76
77
78
79
80
81
# File 'lib/active_record/connection_adapters/mysql_adapter.rb', line 71

def self.string_to_time(value)
  return super unless Mysql::Time === value
  new_time(
    value.year,
    value.month,
    value.day,
    value.hour,
    value.minute,
    value.second,
    value.second_part)
end

Instance Method Details

#adapterObject



93
94
95
# File 'lib/active_record/connection_adapters/mysql_adapter.rb', line 93

def adapter
  MysqlAdapter
end