Sha256: bbbe39f21355873ec7c7c8b17ba7dff267682096e25e66657c3d32c90fc6ebe0

Contents?: true

Size: 680 Bytes

Versions: 5

Compression:

Stored size: 680 Bytes

Contents

module Arel
  ###
  # Methods for creating various nodes
  module FactoryMethods
    def create_table_alias relation, name
      Nodes::TableAlias.new(relation, name)
    end

    def create_join to, constraint = nil, klass = Nodes::InnerJoin
      klass.new(to, constraint)
    end

    def create_string_join to
      create_join to, nil, Nodes::StringJoin
    end

    def create_and clauses
      Nodes::And.new clauses
    end

    def create_on expr
      Nodes::On.new expr
    end

    def grouping expr
      Nodes::Grouping.new expr
    end

    ###
    # Create a LOWER() function
    def lower column
      Nodes::NamedFunction.new 'LOWER', [column]
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
arel-2.1.4 lib/arel/factory_methods.rb
arel-2.1.3 lib/arel/factory_methods.rb
arel-2.1.2 lib/arel/factory_methods.rb
arel-2.1.1 lib/arel/factory_methods.rb
arel-2.1.0 lib/arel/factory_methods.rb