Class: ActiveRecord::ConnectionAdapters::MysqlAdapter::Fields::Date

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

Instance Method Summary collapse

Methods inherited from Type

#type_cast_for_write

Instance Method Details

#typeObject



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

def type; :date; end

#type_cast(value) ⇒ Object



321
322
323
324
325
326
327
# File 'lib/active_record/connection_adapters/mysql_adapter.rb', line 321

def type_cast(value)
  return if value.nil?

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