aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2010-08-11 15:02:19 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2010-08-11 15:02:19 -0700
commitbcf73b8c482ef07dc6f037dd4acc41ebc2e36bec (patch)
tree3bfff278db0b0e5de09167238a02b386b6401b51
parent72d329055508bddb4ee4852384446a319ebffb48 (diff)
downloadrails-bcf73b8c482ef07dc6f037dd4acc41ebc2e36bec.tar.gz
rails-bcf73b8c482ef07dc6f037dd4acc41ebc2e36bec.tar.bz2
rails-bcf73b8c482ef07dc6f037dd4acc41ebc2e36bec.zip
use empty? over all?
-rw-r--r--lib/arel/algebra/relations/relation.rb6
1 files changed, 5 insertions, 1 deletions
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