Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Readds the fix for #5667 and back ports the regression fix from #5718 #5898

Merged
merged 4 commits into from Apr 19, 2012
Merged

Readds the fix for #5667 and back ports the regression fix from #5718 #5898

merged 4 commits into from Apr 19, 2012

Commits on Apr 19, 2012

  1. Removes caching from ActiveRecord::Core::ClassMethods#relation

    The #relation method gets called in four places and the return value was instantly cloned in three of them. The only place that did not clone was ActiveRecord::Scoping::Default::ClassMethods#unscoped. This introduced a bug described in #5667 and should really clone the relation, too. This means all four places would clone the relation, so it doesn't make a lot of sense caching it in the first place.
    
    The four places with calls to relations are:
    
    activerecord/lib/active_record/scoping/default.rb:110:in `block in build_default_scope'"
    activerecord/lib/active_record/scoping/default.rb:42:in `unscoped'"
    activerecord/lib/active_record/scoping/named.rb:38:in `scoped'"
    activerecord/lib/active_record/scoping/named.rb:52:in `scope_attributes'"
    
    Conflicts:
    
    	activerecord/lib/active_record/core.rb
    benedikt committed Apr 19, 2012
    Copy the full SHA
    13f1401 View commit details
    Browse the repository at this point in the history
  2. Adds test to check that circular preloading does not modify Model.uns…

    …coped (as described in #5667)
    
    Conflicts:
    
    	activerecord/test/cases/associations/eager_test.rb
    benedikt committed Apr 19, 2012
    Copy the full SHA
    8491740 View commit details
    Browse the repository at this point in the history
  3. Revert "Revert "Fix #5667. Preloading should ignore scoping.""

    This reverts commit 1166d49.
    
    Conflicts:
    
    	activerecord/test/cases/associations/eager_test.rb
    benedikt committed Apr 19, 2012
    Copy the full SHA
    2c21a2f View commit details
    Browse the repository at this point in the history
  4. Copy the full SHA
    ebfa58a View commit details
    Browse the repository at this point in the history