Commit 7bbcd7b5 authored by Robert Speicher's avatar Robert Speicher

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
parents 95ebdf30 b84b32ed
......@@ -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
......
---
title: Passing an argument to force an association to reload is now deprecated
merge_request: 23334
author: Jasper Maes
type: other
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment