Class: ActiveRecord::ConnectionAdapters::MysqlAdapter::Fields::Float

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



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

def type; :float; end

#type_cast(value) ⇒ Object



357
358
359
360
361
# File 'lib/active_record/connection_adapters/mysql_adapter.rb', line 357

def type_cast(value)
  return if value.nil?

  value.to_f
end