diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2010-08-18 11:51:32 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2010-08-18 11:51:59 -0700 |
commit | 93f335b6fbfe7745678103f8f371d22a4d1ad7ab (patch) | |
tree | 63a0cbbd645b5efbd0eb62781ea6e6044775cc8f | |
parent | 3e871eee8048c0e11e270ae4fbcbe40226148c33 (diff) | |
download | rails-93f335b6fbfe7745678103f8f371d22a4d1ad7ab.tar.gz rails-93f335b6fbfe7745678103f8f371d22a4d1ad7ab.tar.bz2 rails-93f335b6fbfe7745678103f8f371d22a4d1ad7ab.zip |
call to present? is not necessary
-rw-r--r-- | activerecord/lib/active_record/relation/calculations.rb | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/relation/calculations.rb b/activerecord/lib/active_record/relation/calculations.rb index 64edcc1ef3..91c1e14028 100644 --- a/activerecord/lib/active_record/relation/calculations.rb +++ b/activerecord/lib/active_record/relation/calculations.rb @@ -166,8 +166,7 @@ module ActiveRecord if operation == "count" column_name ||= (select_for_count || :all) - joins = arel.joins(arel) - if joins.present? && joins =~ /LEFT OUTER/i + if arel.joins(arel) =~ /LEFT OUTER/i distinct = true column_name = @klass.primary_key if column_name == :all end |