Class: ActiveRecord::ConnectionAdapters::AbstractMysqlAdapter::MysqlString

Inherits:
Type::String show all
Defined in:
activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb

Overview

:nodoc:

Instance Attribute Summary

Attributes inherited from Type::Value

#limit, #precision, #scale

Instance Method Summary collapse

Methods inherited from Type::String

#changed_in_place?, #text?, #type

Methods inherited from Type::Value

#==, #binary?, #changed?, #changed_in_place?, #hash, #initialize, #klass, #number?, #text?, #type, #type_cast_for_schema, #type_cast_from_database, #type_cast_from_user

Constructor Details

This class inherits a constructor from ActiveRecord::Type::Value

Instance Method Details

#type_cast_for_database(value) ⇒ Object


926
927
928
929
930
931
932
# File 'activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb', line 926

def type_cast_for_database(value)
  case value
  when true then "1"
  when false then "0"
  else super
  end
end