Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
heptapod
heptapod
Commits
852efa0c06f0
Commit
852efa0c
authored
Feb 20, 2019
by
Matija Čupić
Browse files
Delegate last_pipeline to Project
parent
98bfa6e78c2c
Changes
2
Hide whitespace changes
Inline
Side-by-side
app/models/project.rb
View file @
852efa0c
...
...
@@ -305,6 +305,7 @@
delegate
:group_runners_enabled
,
:group_runners_enabled
=
,
:group_runners_enabled?
,
to: :ci_cd_settings
delegate
:group_clusters_enabled?
,
to: :group
,
allow_nil:
true
delegate
:root_ancestor
,
to: :namespace
,
allow_nil:
true
delegate
:last_pipeline
,
to: :commit
,
allow_nil:
true
# Validations
validates
:creator
,
presence:
true
,
on: :create
...
...
spec/models/project_spec.rb
View file @
852efa0c
...
...
@@ -458,6 +458,7 @@
it
{
is_expected
.
to
delegate_method
(
:name
).
to
(
:owner
).
with_prefix
(
true
).
with_arguments
(
allow_nil:
true
)
}
it
{
is_expected
.
to
delegate_method
(
:group_clusters_enabled?
).
to
(
:group
).
with_arguments
(
allow_nil:
true
)
}
it
{
is_expected
.
to
delegate_method
(
:root_ancestor
).
to
(
:namespace
).
with_arguments
(
allow_nil:
true
)
}
it
{
is_expected
.
to
delegate_method
(
:last_pipeline
).
to
(
:commit
).
with_arguments
(
allow_nil:
true
)
}
end
describe
'#to_reference_with_postfix'
do
...
...
Write
Preview
Supports
Markdown
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