Sha256: 3828f995f02c8e6073cdf42632cc7f2c45374c25cd921e3f6f34fb7012f3bcd9

Contents?: true

Size: 422 Bytes

Versions: 2

Compression:

Stored size: 422 Bytes

Contents

require 'arel/visitors/to_sql'

module Arel
  module Visitors
    class ToSql
      def visit_Array o, a
        column = a.relation.engine.connection.columns(a.relation.name).find { |col| col.name == a.name.to_s } if a
        if column && column.respond_to?(:array) && column.array
          quoted o, a
        else
          o.empty? ? 'NULL' : o.map { |x| visit x }.join(', ')
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
postgres_ext-2.3.0 lib/postgres_ext/arel/visitors/to_sql.rb
postgres_ext-2.2.0 lib/postgres_ext/arel/visitors/to_sql.rb