fix clause passing

This commit is contained in:
Loic Nageleisen 2017-03-01 16:52:43 +01:00
parent 421ae6d32e
commit 2c727a38cb

View file

@ -73,20 +73,20 @@ module Rebel::SQL
n ? as(n) : self
end
def on(clause)
Raw.new(self + " ON #{Rebel::SQL.and_clause(clause)}")
def on(*clause)
Raw.new(self + " ON #{Rebel::SQL.and_clause(*clause)}")
end
def on?(clause)
def on?(*clause)
clause ? on(clause) : self
end
def and(clause)
Raw.new("#{self} AND #{Rebel::SQL.and_clause(clause)}")
def and(*clause)
Raw.new("#{self} AND #{Rebel::SQL.and_clause(*clause)}")
end
def or(clause)
Raw.new("#{self} OR #{Rebel::SQL.and_clause(clause)}").wants_parens!
def or(*clause)
Raw.new("#{self} OR #{Rebel::SQL.and_clause(*clause)}").wants_parens!
end
def eq(n)