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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
9b3b7509
Commit
9b3b7509
authored
Jan 12, 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
22d4a103
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
21 additions
and
15 deletions
+21
-15
ee/app/models/concerns/visible_approvable.rb
ee/app/models/concerns/visible_approvable.rb
+2
-2
ee/changelogs/unreleased/deprecated-passing-argument-to-association.yml
...unreleased/deprecated-passing-argument-to-association.yml
+6
-0
ee/lib/gitlab/elastic/indexer.rb
ee/lib/gitlab/elastic/indexer.rb
+1
-1
ee/spec/controllers/projects/mirrors_controller_spec.rb
ee/spec/controllers/projects/mirrors_controller_spec.rb
+3
-3
ee/spec/controllers/projects/push_rules_controller_spec.rb
ee/spec/controllers/projects/push_rules_controller_spec.rb
+5
-5
ee/spec/features/projects/mirror_spec.rb
ee/spec/features/projects/mirror_spec.rb
+1
-1
ee/spec/models/project_spec.rb
ee/spec/models/project_spec.rb
+1
-1
ee/spec/requests/api/variables_spec.rb
ee/spec/requests/api/variables_spec.rb
+2
-2
No files found.
ee/app/models/concerns/visible_approvable.rb
View file @
9b3b7509
...
...
@@ -75,8 +75,8 @@ module VisibleApprovable
end
def
reset_approval_cache!
approvals
(
true
)
approved_by_users
(
true
)
approvals
.
reload
approved_by_users
.
reload
clear_memoization
(
:approvers_left
)
clear_memoization
(
:all_approvers_including_groups
)
...
...
ee/changelogs/unreleased/deprecated-passing-argument-to-association.yml
0 → 100644
View file @
9b3b7509
---
title
:
'
Fix
deprecation:
Passing
an
argument
to
force
an
association
to
reload
is
now
deprecated'
merge_request
:
9140
author
:
Jasper Maes
type
:
other
ee/lib/gitlab/elastic/indexer.rb
View file @
9b3b7509
...
...
@@ -89,7 +89,7 @@ module Gitlab
sha
=
head_commit
.
try
(
:sha
)
sha
||=
Gitlab
::
Git
::
BLANK_SHA
index_status
.
update
(
last_commit:
sha
,
indexed_at:
Time
.
now
)
project
.
index_status
(
true
)
project
.
reload_index_status
end
# rubocop: enable CodeReuse/ActiveRecord
end
...
...
ee/spec/controllers/projects/mirrors_controller_spec.rb
View file @
9b3b7509
...
...
@@ -159,7 +159,7 @@ describe Projects::MirrorsController do
do_put
(
project
,
{
import_data_attributes:
{
password:
'update'
}
},
format: :json
)
expect
(
response
).
to
have_gitlab_http_status
(
200
)
expect
(
project
.
import_data
(
true
)
.
id
).
to
eq
(
import_data_id
)
expect
(
project
.
reload_import_data
.
id
).
to
eq
(
import_data_id
)
end
it
'sets ssh_known_hosts_verified_at and verified_by when the update sets known hosts'
do
...
...
@@ -167,7 +167,7 @@ describe Projects::MirrorsController do
expect
(
response
).
to
have_gitlab_http_status
(
200
)
import_data
=
project
.
import_data
(
true
)
import_data
=
project
.
reload_import_data
expect
(
import_data
.
ssh_known_hosts_verified_at
).
to
be_within
(
1
.
minute
).
of
(
Time
.
now
)
expect
(
import_data
.
ssh_known_hosts_verified_by
).
to
eq
(
project
.
owner
)
end
...
...
@@ -179,7 +179,7 @@ describe Projects::MirrorsController do
expect
(
response
).
to
have_gitlab_http_status
(
200
)
import_data
=
project
.
import_data
(
true
)
import_data
=
project
.
reload_import_data
expect
(
import_data
.
ssh_known_hosts_verified_at
).
to
be_nil
expect
(
import_data
.
ssh_known_hosts_verified_by
).
to
be_nil
end
...
...
ee/spec/controllers/projects/push_rules_controller_spec.rb
View file @
9b3b7509
...
...
@@ -19,7 +19,7 @@ describe Projects::PushRulesController do
do_update
expect
(
response
).
to
have_gitlab_http_status
(
302
)
expect
(
project
.
push_rule
(
true
)
.
prevent_secrets
).
to
be_truthy
expect
(
project
.
reload_push_rule
.
prevent_secrets
).
to
be_truthy
end
context
'push rules unlicensed'
do
...
...
@@ -42,7 +42,7 @@ describe Projects::PushRulesController do
it
'updates the setting'
do
patch
:update
,
params:
{
namespace_id:
project
.
namespace
,
project_id:
project
,
id:
1
,
push_rule:
{
rule_attr
=>
true
}
}
expect
(
project
.
push_rule
(
true
)
.
public_send
(
rule_attr
)).
to
be_truthy
expect
(
project
.
reload_push_rule
.
public_send
(
rule_attr
)).
to
be_truthy
end
end
...
...
@@ -55,7 +55,7 @@ describe Projects::PushRulesController do
it
'updates the setting'
do
patch
:update
,
params:
{
namespace_id:
project
.
namespace
,
project_id:
project
,
id:
1
,
push_rule:
{
rule_attr
=>
true
}
}
expect
(
project
.
push_rule
(
true
)
.
public_send
(
rule_attr
)).
to
be_truthy
expect
(
project
.
reload_push_rule
.
public_send
(
rule_attr
)).
to
be_truthy
end
end
...
...
@@ -67,7 +67,7 @@ describe Projects::PushRulesController do
it
'does not update the setting'
do
patch
:update
,
params:
{
namespace_id:
project
.
namespace
,
project_id:
project
,
id:
1
,
push_rule:
{
rule_attr
=>
false
}
}
expect
(
project
.
push_rule
(
true
)
.
public_send
(
rule_attr
)).
to
be_truthy
expect
(
project
.
reload_push_rule
.
public_send
(
rule_attr
)).
to
be_truthy
end
end
end
...
...
@@ -80,7 +80,7 @@ describe Projects::PushRulesController do
it
'does not update the setting'
do
patch
:update
,
params:
{
namespace_id:
project
.
namespace
,
project_id:
project
,
id:
1
,
push_rule:
{
rule_attr
=>
true
}
}
expect
(
project
.
push_rule
(
true
)
.
public_send
(
rule_attr
)).
to
be_falsy
expect
(
project
.
reload_push_rule
.
public_send
(
rule_attr
)).
to
be_falsy
end
end
end
...
...
ee/spec/features/projects/mirror_spec.rb
View file @
9b3b7509
...
...
@@ -54,7 +54,7 @@ describe 'Project mirror', :js do
describe
'configuration'
do
# Start from a project with no mirroring set up
let
(
:project
)
{
create
(
:project
,
:repository
,
creator:
user
)
}
let
(
:import_data
)
{
project
.
import_data
(
true
)
}
let
(
:import_data
)
{
project
.
reload_import_data
}
before
do
project
.
add_maintainer
(
user
)
...
...
ee/spec/models/project_spec.rb
View file @
9b3b7509
...
...
@@ -240,7 +240,7 @@ describe Project do
describe
'#push_rule'
do
let
(
:project
)
{
create
(
:project
,
push_rule:
create
(
:push_rule
))
}
subject
(
:push_rule
)
{
project
.
push_rule
(
true
)
}
subject
(
:push_rule
)
{
project
.
reload_push_rule
}
it
{
is_expected
.
not_to
be_nil
}
...
...
ee/spec/requests/api/variables_spec.rb
View file @
9b3b7509
...
...
@@ -15,7 +15,7 @@ describe API::Variables do
it
'creates variable with a specific environment scope'
do
expect
do
post
api
(
"/projects/
#{
project
.
id
}
/variables"
,
user
),
params:
{
key:
'TEST_VARIABLE_2'
,
value:
'VALUE_2'
,
environment_scope:
'review/*'
}
end
.
to
change
{
project
.
variables
(
true
)
.
count
}.
by
(
1
)
end
.
to
change
{
project
.
variables
.
reload
.
count
}.
by
(
1
)
expect
(
response
).
to
have_gitlab_http_status
(
201
)
expect
(
json_response
[
'key'
]).
to
eq
(
'TEST_VARIABLE_2'
)
...
...
@@ -28,7 +28,7 @@ describe API::Variables do
expect
do
post
api
(
"/projects/
#{
project
.
id
}
/variables"
,
user
),
params:
{
key:
variable
.
key
,
value:
'VALUE_2'
,
environment_scope:
'review/*'
}
end
.
to
change
{
project
.
variables
(
true
)
.
count
}.
by
(
1
)
end
.
to
change
{
project
.
variables
.
reload
.
count
}.
by
(
1
)
expect
(
response
).
to
have_gitlab_http_status
(
201
)
expect
(
json_response
[
'key'
]).
to
eq
(
variable
.
key
)
...
...
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