Sha256: c055222bd74ee00884fe00ca7fa8f4e63cc188c634b7db4aa22e2fe73c2a3440

Contents?: true

Size: 731 Bytes

Versions: 1

Compression:

Stored size: 731 Bytes

Contents

module Archon
  # Factory method
  def self.values_list expressions
    return Nodes::ValuesList.new expressions
  end

  module Nodes
    class ValuesList < Arel::Nodes::Binary
      alias :expressions :left
      alias :expressions= :left=
      alias :columns :right
      alias :columns= :right=

      def initialize expressions
        super expressions, []
      end
    end
  end

  # Only include the visitor module on the SQL vendors that support it:
  Arel::Visitors::PostgreSQL.class_eval do
    include Archon::Visitors::ValuesList
  end

  Arel::Visitors::Oracle.class_eval do
    include Archon::Visitors::ValuesList
  end

  Arel::Visitors::Oracle12.class_eval do
    include Archon::Visitors::ValuesList
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
archon-0.0.4 lib/archon/nodes/values_list.rb