Fix ActiveRecord::ImmutableRelation is raised when collection caching and HTTP caching are used together#32536
Merged
rafaelfranca merged 1 commit intorails:masterfrom Apr 12, 2018
Conversation
…'t effect the arel and the arel may already be generated by fresh_when
|
(@rails-bot has picked a reviewer for you, use r? to override) |
Member
|
Thanks! That was the exactly fix I had in mind. |
rafaelfranca
added a commit
that referenced
this pull request
Apr 12, 2018
…r-with-http-caching-and-collection-caching Fix ActiveRecord::ImmutableRelation is raised when collection caching and HTTP caching are used together
Contributor
|
Thanks for the speedy fix, @lsylvester! |
y-yagi
added a commit
that referenced
this pull request
Apr 12, 2018
…ion-error-with-http-caching-and-collection-caching" This reverts commit 8b0cdbe. Reason: #31250 is not backported to 5-2-stable, and this change broke build. https://travis-ci.org/rails/rails/builds/365396137
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
skip_preloading!was asserting immutability, but the arel may have already been defined by usingfresh_whenin the controller.As
skip_preloading!has no effect on the sql being generated it should be safe to skip this check when setting this value.This PR removes
skip_preloadingfrom theSINGLE_VALUE_METHODSthat are used to define setters that use theassert_immutabilitycheck, and replaces it a attribute accessor on the relation.Fixes #32534
/cc @georgeclaghorn