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
Jérome Perrin
gitlab-ce
Commits
47dccfb3
Commit
47dccfb3
authored
Sep 12, 2016
by
Lin Jen-Shin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix test (credits to Kamil)
parent
683d8b7f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
+4
-3
app/models/concerns/has_status.rb
app/models/concerns/has_status.rb
+4
-3
No files found.
app/models/concerns/has_status.rb
View file @
47dccfb3
...
@@ -8,8 +8,9 @@ module HasStatus
...
@@ -8,8 +8,9 @@ module HasStatus
class_methods
do
class_methods
do
def
status_sql
def
status_sql
scope
=
all
.
relevant
scope
=
all
builds
=
scope
.
select
(
'count(*)'
).
to_sql
builds
=
scope
.
select
(
'count(*)'
).
to_sql
created
=
scope
.
created
.
select
(
'count(*)'
).
to_sql
success
=
scope
.
success
.
select
(
'count(*)'
).
to_sql
success
=
scope
.
success
.
select
(
'count(*)'
).
to_sql
ignored
=
scope
.
ignored
.
select
(
'count(*)'
).
to_sql
if
scope
.
respond_to?
(
:ignored
)
ignored
=
scope
.
ignored
.
select
(
'count(*)'
).
to_sql
if
scope
.
respond_to?
(
:ignored
)
ignored
||=
'0'
ignored
||=
'0'
...
@@ -22,9 +23,9 @@ module HasStatus
...
@@ -22,9 +23,9 @@ module HasStatus
WHEN (
#{
builds
}
)=0 THEN NULL
WHEN (
#{
builds
}
)=0 THEN NULL
WHEN (
#{
builds
}
)=(
#{
skipped
}
) THEN 'skipped'
WHEN (
#{
builds
}
)=(
#{
skipped
}
) THEN 'skipped'
WHEN (
#{
builds
}
)=(
#{
success
}
)+(
#{
ignored
}
)+(
#{
skipped
}
) THEN 'success'
WHEN (
#{
builds
}
)=(
#{
success
}
)+(
#{
ignored
}
)+(
#{
skipped
}
) THEN 'success'
WHEN (
#{
builds
}
)=(
#{
pending
}
)+(
#{
skipped
}
) THEN 'pending'
WHEN (
#{
builds
}
)=(
#{
created
}
)+(
#{
pending
}
)+(
#{
skipped
}
) THEN 'pending'
WHEN (
#{
builds
}
)=(
#{
canceled
}
)+(
#{
success
}
)+(
#{
ignored
}
)+(
#{
skipped
}
) THEN 'canceled'
WHEN (
#{
builds
}
)=(
#{
canceled
}
)+(
#{
success
}
)+(
#{
ignored
}
)+(
#{
skipped
}
) THEN 'canceled'
WHEN (
#{
running
}
)+(
#{
pending
}
)>0 THEN 'running'
WHEN (
#{
running
}
)+(
#{
pending
}
)
+(
#{
created
}
)
>0 THEN 'running'
ELSE 'failed'
ELSE 'failed'
END)"
END)"
...
...
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