From d22b2169f7151d076b06bfa5da85dbe5497d8ea4 Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Fri, 30 Jul 2010 10:02:34 -0700 Subject: PERF: where is only ever called with 0 or 1 arguments. eliminate *args --- lib/arel/algebra/relations/relation.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'lib/arel/algebra') diff --git a/lib/arel/algebra/relations/relation.rb b/lib/arel/algebra/relations/relation.rb index 97aa779926..0441b14382 100644 --- a/lib/arel/algebra/relations/relation.rb +++ b/lib/arel/algebra/relations/relation.rb @@ -126,7 +126,7 @@ module Arel end %w{ - having group order where project + having group order project }.each do |op| class_eval <<-OPERATION, __FILE__, __LINE__ def #{op}(*args) @@ -135,6 +135,10 @@ module Arel OPERATION end + def where clause = nil + clause ? Where.new(self, [clause]) : self + end + def skip thing = nil thing ? Skip.new(self, thing) : self end -- cgit v1.2.3