diff options
author | Michał Łomnicki <michal.lomnicki@gmail.com> | 2010-12-12 01:37:56 +0100 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2010-12-23 15:19:17 -0800 |
commit | 030480ac1f4fbf8bf74a0d9298544426caf26894 (patch) | |
tree | ffbd1e3614e50ce045b0d095f3ed49b3751f3adf /activerecord/lib/active_record/associations/through_association_scope.rb | |
parent | 85683f2a79dbf81130361cb6426786cf6b0d1925 (diff) | |
download | rails-030480ac1f4fbf8bf74a0d9298544426caf26894.tar.gz rails-030480ac1f4fbf8bf74a0d9298544426caf26894.tar.bz2 rails-030480ac1f4fbf8bf74a0d9298544426caf26894.zip |
Fix behaviour of foo.has_many_through_association.select('custom select') [#6089 state:resolved]
Diffstat (limited to 'activerecord/lib/active_record/associations/through_association_scope.rb')
-rw-r--r-- | activerecord/lib/active_record/associations/through_association_scope.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/associations/through_association_scope.rb b/activerecord/lib/active_record/associations/through_association_scope.rb index 99920d4c63..c11fce5db0 100644 --- a/activerecord/lib/active_record/associations/through_association_scope.rb +++ b/activerecord/lib/active_record/associations/through_association_scope.rb @@ -63,8 +63,8 @@ module ActiveRecord end def construct_select(custom_select = nil) - distinct = "DISTINCT " if @reflection.options[:uniq] - custom_select || @reflection.options[:select] || "#{distinct}#{@reflection.quoted_table_name}.*" + distinct = "DISTINCT #{@reflection.quoted_table_name}.*" if @reflection.options[:uniq] + custom_select || @reflection.options[:select] || distinct end def construct_joins |