Flowdock
method

_type_cast

Importance_0
v6.1.3.1 - Show latest stable - 0 notes - Class: ActiveRecord::ConnectionAdapters::Quoting
_type_cast(value) private

No documentation

This method has no description. You can help the Ruby on Rails community by adding new notes.

Hide source
# File activerecord/lib/active_record/connection_adapters/abstract/quoting.rb, line 235
        def _type_cast(value)
          case value
          when Symbol, ActiveSupport::Multibyte::Chars, Type::Binary::Data
            value.to_s
          when true       then unquoted_true
          when false      then unquoted_false
          # BigDecimals need to be put in a non-normalized form and quoted.
          when BigDecimal then value.to_s("F")
          when nil, Numeric, String then value
          when Type::Time::Value then quoted_time(value)
          when Date, Time then quoted_date(value)
          else raise TypeError, "can't cast #{value.class.name}"
          end
        end
Register or log in to add new notes.