type_cast (ActiveRecord::ConnectionAdapters::Column)

    # File lib/active_record/connection_adapters/abstract/schema_definitions.rb, line 64
          def type_cast(value)
            return nil if value.nil?
            case type
              when :string    then value
              when :text      then value
              when :integer   then value.to_i rescue value ? 1 : 0
              when :float     then value.to_f
              when :decimal   then self.class.value_to_decimal(value)
              when :datetime  then self.class.string_to_time(value)
              when :timestamp then self.class.string_to_time(value)
              when :time      then self.class.string_to_dummy_time(value)
              when :date      then self.class.string_to_date(value)
              when :binary    then self.class.binary_to_string(value)
              when :boolean   then self.class.value_to_boolean(value)
              else value
            end
          end