Class: ActiveRecord::ConnectionAdapters::MysqlAdapter::Fields::DateTime

Inherits:
Type
  • Object
show all
Defined in:
activerecord/lib/active_record/connection_adapters/mysql_adapter.rb

Instance Method Summary collapse

Methods inherited from Type

#type_cast_for_write

Instance Method Details

#typeObject



335
# File 'activerecord/lib/active_record/connection_adapters/mysql_adapter.rb', line 335

def type; :datetime; end

#type_cast(value) ⇒ Object



337
338
339
340
341
342
343
# File 'activerecord/lib/active_record/connection_adapters/mysql_adapter.rb', line 337

def type_cast(value)
  return if value.nil?

  # FIXME: probably we can improve this since we know it is mysql
  # specific
  ConnectionAdapters::Column.string_to_time value
end