method

quote_and_escape

rails latest stable - Class: ActiveRecord::ConnectionAdapters::PostgreSQL::OID::Array

Method deprecated or moved

This method is deprecated or moved on the latest stable version. The last existing version (v4.2.9) is shown here.

quote_and_escape(value)
private

No documentation available.

# File activerecord/lib/active_record/connection_adapters/postgresql/oid/array.rb, line 72
          def quote_and_escape(value)
            case value
            when ::String
              if string_requires_quoting?(value)
                value = value.gsub(/\\/, ARRAY_ESCAPE)
                value.gsub!(/"/,"\\\"")
                %("#{value}")
              else
                value
              end
            when nil then "NULL"
            when ::Date, ::DateTime, ::Time then subtype.type_cast_for_schema(value)
            else value
            end
          end