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

Inherits:
Type::String show all
Defined in:
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?, #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



891
892
893
894
895
896
897
# File 'lib/active_record/connection_adapters/abstract_mysql_adapter.rb', line 891

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