Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
gitlab-ce
Commits
16c1c0b1
Commit
16c1c0b1
authored
Jan 03, 2019
by
Jasper Maes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix deprecation: Passing an argument to force an association to reload is now deprecated
parent
fe4f8cad
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
12 additions
and
6 deletions
+12
-6
app/models/concerns/manual_inverse_association.rb
app/models/concerns/manual_inverse_association.rb
+2
-2
changelogs/unreleased/deprecated-force-reload.yml
changelogs/unreleased/deprecated-force-reload.yml
+6
-0
spec/models/concerns/manual_inverse_association_spec.rb
spec/models/concerns/manual_inverse_association_spec.rb
+2
-2
spec/models/gpg_key_spec.rb
spec/models/gpg_key_spec.rb
+1
-1
spec/services/ci/process_pipeline_service_spec.rb
spec/services/ci/process_pipeline_service_spec.rb
+1
-1
No files found.
app/models/concerns/manual_inverse_association.rb
View file @
16c1c0b1
...
@@ -5,8 +5,8 @@ module ManualInverseAssociation
...
@@ -5,8 +5,8 @@ module ManualInverseAssociation
class_methods
do
class_methods
do
def
manual_inverse_association
(
association
,
inverse
)
def
manual_inverse_association
(
association
,
inverse
)
define_method
(
association
)
do
|*
args
|
define_method
(
association
)
do
super
(
*
args
).
tap
do
|
value
|
super
().
tap
do
|
value
|
next
unless
value
next
unless
value
child_association
=
value
.
association
(
inverse
)
child_association
=
value
.
association
(
inverse
)
...
...
changelogs/unreleased/deprecated-force-reload.yml
0 → 100644
View file @
16c1c0b1
---
title
:
'
Fix
deprecation:
Passing
an
argument
to
force
an
association
to
reload
is
now
deprecated'
merge_request
:
24136
author
:
Jasper Maes
type
:
other
spec/models/concerns/manual_inverse_association_spec.rb
View file @
16c1c0b1
...
@@ -32,10 +32,10 @@ describe ManualInverseAssociation do
...
@@ -32,10 +32,10 @@ describe ManualInverseAssociation do
.
not_to
exceed_query_limit
(
0
)
.
not_to
exceed_query_limit
(
0
)
end
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
query_count
=
ActiveRecord
::
QueryRecorder
.
new
do
instance
.
manual_association
instance
.
manual_association
instance
.
manual_association
(
true
)
instance
.
reload_manual_association
end
.
count
end
.
count
expect
(
query_count
).
to
eq
(
2
)
expect
(
query_count
).
to
eq
(
2
)
...
...
spec/models/gpg_key_spec.rb
View file @
16c1c0b1
...
@@ -199,7 +199,7 @@ describe GpgKey do
...
@@ -199,7 +199,7 @@ describe GpgKey do
gpg_key
.
revoke
gpg_key
.
revoke
expect
(
gpg_key
.
subkeys
(
true
)
).
to
be_blank
expect
(
gpg_key
.
subkeys
.
reload
).
to
be_blank
end
end
it
'invalidates all signatures associated to the subkeys'
do
it
'invalidates all signatures associated to the subkeys'
do
...
...
spec/services/ci/process_pipeline_service_spec.rb
View file @
16c1c0b1
...
@@ -762,7 +762,7 @@ describe Ci::ProcessPipelineService, '#execute' do
...
@@ -762,7 +762,7 @@ describe Ci::ProcessPipelineService, '#execute' do
end
end
def
manual_actions
def
manual_actions
pipeline
.
manual_actions
(
true
)
pipeline
.
manual_actions
.
reload
end
end
def
create_build
(
name
,
**
opts
)
def
create_build
(
name
,
**
opts
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment