Class: ActiveRecord::ConnectionAdapters::MysqlAdapter::Fields::Integer
- Inherits:
-
Type
- Object
- Type
- ActiveRecord::ConnectionAdapters::MysqlAdapter::Fields::Integer
show all
- Defined in:
- lib/active_record/connection_adapters/mysql_adapter.rb
Instance Method Summary
collapse
Methods inherited from Type
#type, #type_cast_for_write
Instance Method Details
#type_cast(value) ⇒ Object
314
315
316
317
318
|
# File 'lib/active_record/connection_adapters/mysql_adapter.rb', line 314
def type_cast(value)
return if value.nil?
value.to_i rescue value ? 1 : 0
end
|