Module: Arel::Sql::ArrayExtensions

Defined in:
lib/arel/engines/sql/core_extensions/array.rb

Instance Method Summary collapse

Instance Method Details

#exclusion_predicate_sqlObject



16
17
18
# File 'lib/arel/engines/sql/core_extensions/array.rb', line 16

def exclusion_predicate_sql
  "NOT IN"
end

#inclusion_predicate_sqlObject



12
13
14
# File 'lib/arel/engines/sql/core_extensions/array.rb', line 12

def inclusion_predicate_sql
  "IN"
end

#to_sql(formatter = nil) ⇒ Object



4
5
6
7
8
9
10
# File 'lib/arel/engines/sql/core_extensions/array.rb', line 4

def to_sql(formatter = nil)
  if any?
    "(" + collect { |e| e.to_sql(formatter) }.join(', ') + ")"
  else
    "(NULL)"
  end
end