Sha256: 071e43ffa349ebafbe293726b8d3a91f5f3dab01f0226e57d4d1eed3011b31df

Contents?: true

Size: 985 Bytes

Versions: 4

Compression:

Stored size: 985 Bytes

Contents

require 'arel/predications'

module Arel
  module Predications
    def contained_within(other)
      Nodes::ContainedWithin.new self, Nodes.build_quoted(other, self)
    end

    def contained_within_or_equals(other)
      Nodes::ContainedWithinEquals.new self, Nodes.build_quoted(other, self)
    end

    def contains(other)
      Nodes::Contains.new self, Nodes.build_quoted(other, self)
    end

    def contains_or_equals(other)
      Nodes::ContainsEquals.new self, Nodes.build_quoted(other, self)
    end

    def overlap(other)
      Nodes::Overlap.new self, Nodes.build_quoted(other, self)
    end

    def any(other)
      any_tags_function = Arel::Nodes::NamedFunction.new('ANY', [self])
      Arel::Nodes::Equality.new(Nodes.build_quoted(other, self), any_tags_function)
    end

    def all(other)
      any_tags_function = Arel::Nodes::NamedFunction.new('ALL', [self])
      Arel::Nodes::Equality.new(Nodes.build_quoted(other, self), any_tags_function)
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
postgres_ext-3.0.0 lib/postgres_ext/arel/4.2/predications.rb
postgres_ext-2.4.1 lib/postgres_ext/arel/4.2/predications.rb
postgres_ext-2.4.0 lib/postgres_ext/arel/4.2/predications.rb
postgres_ext-2.4.0.beta.1 lib/postgres_ext/arel/4.2/predications.rb