method

cast

Importance_0
v7.1.3.4 - Show latest stable - 0 notes - Class: Array
cast(value) public

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/postgresql/oid/array.rb, line 34
          def cast(value)
            if value.is_a?(::String)
              value = begin
                @pg_decoder.decode(value)
              rescue TypeError
                # malformed array string is treated as [], will raise in PG 2.0 gem
                # this keeps a consistent implementation
                []
              end
            end
            type_cast_array(value, :cast)
          end
Register or log in to add new notes.