Commit 16c1c0b1 authored by Jasper Maes's avatar Jasper Maes

Fix deprecation: Passing an argument to force an association to reload is now deprecated

parent fe4f8cad
......@@ -5,8 +5,8 @@ module ManualInverseAssociation
class_methods do
def manual_inverse_association(association, inverse)
define_method(association) do |*args|
super(*args).tap do |value|
define_method(association) do
super().tap do |value|
next unless value
child_association = value.association(inverse)
......
---
title: 'Fix deprecation: Passing an argument to force an association to reload is
now deprecated'
merge_request: 24136
author: Jasper Maes
type: other
......@@ -32,10 +32,10 @@ describe ManualInverseAssociation do
.not_to exceed_query_limit(0)
end
it 'passes arguments to the default association method, to allow reloading' do
it 'allows reloading the relation' do
query_count = ActiveRecord::QueryRecorder.new do
instance.manual_association
instance.manual_association(true)
instance.reload_manual_association
end.count
expect(query_count).to eq(2)
......
......@@ -199,7 +199,7 @@ describe GpgKey do
gpg_key.revoke
expect(gpg_key.subkeys(true)).to be_blank
expect(gpg_key.subkeys.reload).to be_blank
end
it 'invalidates all signatures associated to the subkeys' do
......
......@@ -762,7 +762,7 @@ describe Ci::ProcessPipelineService, '#execute' do
end
def manual_actions
pipeline.manual_actions(true)
pipeline.manual_actions.reload
end
def create_build(name, **opts)
......
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