Sha256: 09cf44578c4fdecb209c27d6e9d322205a2b2c8f3da6e2ab2a0f23354ceda232

Contents?: true

Size: 692 Bytes

Versions: 11

Compression:

Stored size: 692 Bytes

Contents

# rubocop:disable Naming/MethodName
# rubocop:disable Naming/UncommunicativeMethodParamName

module Arel
  module Visitors
    class ToSql
      def visit_Arel_Nodes_NotEqual(o, collector)
        right = o.right
        collector = visit o.left, collector

        if [Arel::Nodes::Unknown, Arel::Nodes::False, Arel::Nodes::True].include?(right.class)
          collector << ' IS NOT '
          visit right, collector

        elsif right.nil?
          collector << ' IS NOT NULL'

        else
          collector << ' != '
          visit right, collector
        end
      end
    end
  end
end

# rubocop:enable Naming/MethodName
# rubocop:enable Naming/UncommunicativeMethodParamName

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
arel_toolkit-0.4.9 lib/arel/extensions/not_equal.rb
arel_toolkit-0.4.8 lib/arel/extensions/not_equal.rb
arel_toolkit-0.4.7 lib/arel/extensions/not_equal.rb
arel_toolkit-0.4.6 lib/arel/extensions/not_equal.rb
arel_toolkit-0.4.5 lib/arel/extensions/not_equal.rb
arel_toolkit-0.4.4 lib/arel/extensions/not_equal.rb
arel_toolkit-0.4.3 lib/arel/extensions/not_equal.rb
arel_toolkit-0.4.2 lib/arel/extensions/not_equal.rb
arel_toolkit-0.4.1 lib/arel/extensions/not_equal.rb
arel_toolkit-0.4.0 lib/arel/extensions/not_equal.rb
arel_toolkit-0.3.0 lib/arel/extensions/not_equal.rb