Sha256: 693637bf0588037b61eb18295a0b5138843c997cced1d6e848b2e29750cc5ad2

Contents?: true

Size: 720 Bytes

Versions: 3

Compression:

Stored size: 720 Bytes

Contents

require 'everywhere/util'

module ActiveRecord
  module QueryMethods
    include Everywhere::Util

    def build_where_with_not_and_like_and_not_like(opts, other = [])
      case opts
      when :not
        build_where_without_not_and_like_and_not_like(*other).map {|r| negate r}
      when :like
        build_where_without_not_and_like_and_not_like(*other).map {|r| Arel::Nodes::Matches.new r.left, r.right}
      when :not_like
        build_where_without_not_and_like_and_not_like(*other).map {|r| Arel::Nodes::DoesNotMatch.new r.left, r.right}
      else
        build_where_without_not_and_like_and_not_like(opts, other)
      end
    end
    alias_method_chain :build_where, :not_and_like_and_not_like
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
everywhere-2.0.0 lib/everywhere/symbol.rb
everywhere-1.0.1 lib/everywhere/symbol.rb
everywhere-1.0.0 lib/everywhere/symbol.rb