aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/associations/through_association.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activerecord/lib/active_record/associations/through_association.rb')
-rw-r--r--activerecord/lib/active_record/associations/through_association.rb19
1 files changed, 5 insertions, 14 deletions
diff --git a/activerecord/lib/active_record/associations/through_association.rb b/activerecord/lib/active_record/associations/through_association.rb
index 2b28dda363..b2f1f941c0 100644
--- a/activerecord/lib/active_record/associations/through_association.rb
+++ b/activerecord/lib/active_record/associations/through_association.rb
@@ -13,15 +13,11 @@ module ActiveRecord
protected
def construct_find_scope
- {
- :conditions => construct_conditions,
- :joins => construct_joins,
- :include => @reflection.options[:include] || @reflection.source_reflection.options[:include],
- :select => construct_select,
- :order => @reflection.options[:order],
- :limit => @reflection.options[:limit],
- :readonly => @reflection.options[:readonly]
- }
+ super.merge(
+ :joins => construct_joins,
+ :include => @reflection.options[:include] ||
+ @reflection.source_reflection.options[:include]
+ )
end
# This scope affects the creation of the associated records (not the join records). At the
@@ -44,11 +40,6 @@ module ActiveRecord
super(aliased_through_table, @reflection.through_reflection)
end
- def construct_select
- @reflection.options[:select] ||
- @reflection.options[:uniq] && "DISTINCT #{@reflection.quoted_table_name}.*"
- end
-
def construct_joins
right = aliased_through_table
left = @reflection.klass.arel_table