diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2010-08-11 15:02:19 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2010-08-11 15:02:19 -0700 |
commit | bcf73b8c482ef07dc6f037dd4acc41ebc2e36bec (patch) | |
tree | 3bfff278db0b0e5de09167238a02b386b6401b51 /lib/arel/algebra | |
parent | 72d329055508bddb4ee4852384446a319ebffb48 (diff) | |
download | rails-bcf73b8c482ef07dc6f037dd4acc41ebc2e36bec.tar.gz rails-bcf73b8c482ef07dc6f037dd4acc41ebc2e36bec.tar.bz2 rails-bcf73b8c482ef07dc6f037dd4acc41ebc2e36bec.zip |
use empty? over all?
Diffstat (limited to 'lib/arel/algebra')
-rw-r--r-- | lib/arel/algebra/relations/relation.rb | 6 |
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 |