Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Move #proxy_association method to AssociationRelation

  • Loading branch information...
commit ee4c0a511a40530aa6b4403dd6a39404fd932878 1 parent 3880a2b
Jon Leighton jonleighton authored
4 activerecord/lib/active_record/association_relation.rb
View
@@ -5,6 +5,10 @@ def initialize(klass, table, association)
@association = association
end
+ def proxy_association
+ @association
+ end
+
private
def exec_queries
4 activerecord/lib/active_record/associations/collection_proxy.rb
View
@@ -847,9 +847,7 @@ def scoping
# Returns a <tt>Relation</tt> object for the records in this association
def scope
- @association.scope.tap do |scope|
- scope.proxy_association = @association
- end
+ @association.scope
end
# :nodoc:
2  activerecord/lib/active_record/relation.rb
View
@@ -17,7 +17,7 @@ class Relation
include FinderMethods, Calculations, SpawnMethods, QueryMethods, Batches, Explain, Delegation
attr_reader :table, :klass, :loaded
- attr_accessor :default_scoped, :proxy_association
+ attr_accessor :default_scoped
alias :model :klass
alias :loaded? :loaded
alias :default_scoped? :default_scoped
Please sign in to comment.
Something went wrong with that request. Please try again.