Sha256: 73bb199b55521535cb8af561cdffea419d407dd2918f8ec43796e56e19ca59ab

Contents?: true

Size: 683 Bytes

Versions: 11

Compression:

Stored size: 683 Bytes

Contents

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

module Arel
  module Visitors
    class ToSql
      def visit_Arel_Nodes_Equality(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 '
          visit right, collector

        elsif right.nil?
          collector << ' IS 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/equality.rb
arel_toolkit-0.4.8 lib/arel/extensions/equality.rb
arel_toolkit-0.4.7 lib/arel/extensions/equality.rb
arel_toolkit-0.4.6 lib/arel/extensions/equality.rb
arel_toolkit-0.4.5 lib/arel/extensions/equality.rb
arel_toolkit-0.4.4 lib/arel/extensions/equality.rb
arel_toolkit-0.4.3 lib/arel/extensions/equality.rb
arel_toolkit-0.4.2 lib/arel/extensions/equality.rb
arel_toolkit-0.4.1 lib/arel/extensions/equality.rb
arel_toolkit-0.4.0 lib/arel/extensions/equality.rb
arel_toolkit-0.3.0 lib/arel/extensions/equality.rb