From 2c727a38cbb66c04b792678f87ae2713c056555a Mon Sep 17 00:00:00 2001 From: Loic Nageleisen Date: Wed, 1 Mar 2017 16:52:43 +0100 Subject: [PATCH] fix clause passing --- lib/rebel/sql.rb | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/rebel/sql.rb b/lib/rebel/sql.rb index 90833e0..e2bdeaf 100644 --- a/lib/rebel/sql.rb +++ b/lib/rebel/sql.rb @@ -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)