From bcf73b8c482ef07dc6f037dd4acc41ebc2e36bec Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Wed, 11 Aug 2010 15:02:19 -0700 Subject: use empty? over all? --- lib/arel/algebra/relations/relation.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/arel/algebra/relations/relation.rb b/lib/arel/algebra/relations/relation.rb index 9807cfb984..765d6fe930 100644 --- a/lib/arel/algebra/relations/relation.rb +++ b/lib/arel/algebra/relations/relation.rb @@ -118,7 +118,7 @@ module Arel end %w{ - having group order project + having group order }.each do |op| class_eval <<-OPERATION, __FILE__, __LINE__ def #{op}(*args) @@ -127,6 +127,10 @@ module Arel OPERATION end + def project *args + args.empty? ? self : Project.new(self, args) + end + def where clause = nil clause ? Where.new(self, Array(clause)) : self end -- cgit v1.2.3