Permalink
Browse files

Move #proxy_association method to AssociationRelation

  • Loading branch information...
1 parent 1b02299 commit 32a5cad1e46027cf8234cdb8d556f307b86d4c17 @jonleighton jonleighton committed Apr 12, 2013
@@ -5,6 +5,10 @@ def initialize(klass, table, association)
@association = association
end
+ def proxy_association
+ @association
+ end
+
private
def exec_queries
@@ -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:
@@ -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

0 comments on commit 32a5cad

Please sign in to comment.