Merge branch 'force-reload-arguments-1' into 'master'
Rails 5 deprecation: Passing an argument to force an association to reload is now deprecated See merge request gitlab-org/gitlab-ce!23337
This commit is contained in:
commit
7bbcd7b59b
|
@ -313,7 +313,8 @@ class MergeRequestDiff < ActiveRecord::Base
|
|||
|
||||
# merge_request_diff_commits.reload is preferred way to reload associated
|
||||
# objects but it returns cached result for some reason in this case
|
||||
commits = merge_request_diff_commits(true)
|
||||
# we can circumvent that by specifying that we need an uncached reload
|
||||
commits = self.class.uncached { merge_request_diff_commits.reload }
|
||||
self.commits_count = commits.size
|
||||
end
|
||||
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
title: Passing an argument to force an association to reload is now deprecated
|
||||
merge_request: 23334
|
||||
author: Jasper Maes
|
||||
type: other
|
Loading…
Reference in New Issue