Sha256: c82c6e34f0cc0da608257507625b4a488c55bd743d77dbd5bd23919a26a41e49

Contents?: true

Size: 816 Bytes

Versions: 32

Compression:

Stored size: 816 Bytes

Contents

module Arel
  ###
  # Methods for creating various nodes
  module FactoryMethods
    def create_true
      Arel::Nodes::True.new
    end

    def create_false
      Arel::Nodes::False.new
    end

    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', [Nodes.build_quoted(column)]
    end
  end
end

Version data entries

32 entries across 31 versions & 9 rubygems

Version Path
enju_leaf-1.2.1 vendor/bundle/ruby/2.3/gems/arel-6.0.4/lib/arel/factory_methods.rb
enju_leaf-1.2.1 vendor/bundle/ruby/2.3/gems/arel-7.1.4/lib/arel/factory_methods.rb
autocompl-0.2.2 test/dummy/vendor/bundle/ruby/2.3.0/gems/arel-7.1.4/lib/arel/factory_methods.rb
autocompl-0.2.1 test/dummy/vendor/bundle/ruby/2.3.0/gems/arel-7.1.4/lib/arel/factory_methods.rb
autocompl-0.2.0 test/dummy/vendor/bundle/ruby/2.3.0/gems/arel-7.1.4/lib/arel/factory_methods.rb
autocompl-0.1.2 test/dummy/vendor/bundle/ruby/2.3.0/gems/arel-7.1.4/lib/arel/factory_methods.rb
autocompl-0.1.1 test/dummy/vendor/bundle/ruby/2.3.0/gems/arel-7.1.4/lib/arel/factory_methods.rb
autocompl-0.1.0 test/dummy/vendor/bundle/ruby/2.3.0/gems/arel-7.1.4/lib/arel/factory_methods.rb
autocompl-0.0.1 test/dummy/vendor/bundle/ruby/2.3.0/gems/arel-7.1.4/lib/arel/factory_methods.rb
abaci-0.3.0 vendor/bundle/gems/arel-7.1.0/lib/arel/factory_methods.rb
arel-6.0.4 lib/arel/factory_methods.rb
arel-7.1.4 lib/arel/factory_methods.rb
arel-7.1.3 lib/arel/factory_methods.rb
arel-7.1.2 lib/arel/factory_methods.rb
arel-7.1.1 lib/arel/factory_methods.rb
arel-7.1.0 lib/arel/factory_methods.rb
ish_lib_manager-0.0.1 test/dummy/vendor/bundle/ruby/2.3.0/gems/arel-6.0.3/lib/arel/factory_methods.rb
angular-rails4-templates-0.4.1 vendor/ruby/2.1.0/gems/arel-6.0.3/lib/arel/factory_methods.rb
angular-rails4-templates-0.4.0 vendor/ruby/2.1.0/gems/arel-6.0.3/lib/arel/factory_methods.rb
angular-rails4-templates-0.3.0 vendor/ruby/2.1.0/gems/arel-6.0.3/lib/arel/factory_methods.rb