module Arel::Predications

def not_between(other)

def not_between(other)
  if unboundable?(other.begin) == 1 || unboundable?(other.end) == -1
    not_in([])
  elsif open_ended?(other.begin)
    if open_ended?(other.end)
      if infinity?(other.begin) == 1 || infinity?(other.end) == -1
        not_in([])
      else
        self.in([])
      end
    elsif other.exclude_end?
      gteq(other.end)
    else
      gt(other.end)
    end
  elsif open_ended?(other.end)
    lt(other.begin)
  else
    left = lt(other.begin)
    right = if other.exclude_end?
      gteq(other.end)
    else
      gt(other.end)
    end
    left.or(right)
  end
end