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
Léo-Paul Géneau
gitlab-ce
Commits
b988644a
Commit
b988644a
authored
Jul 07, 2016
by
Lin Jen-Shin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use scope rather than class method
parent
3c89a788
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
4 deletions
+1
-4
app/models/ci/build.rb
app/models/ci/build.rb
+1
-4
No files found.
app/models/ci/build.rb
View file @
b988644a
...
@@ -13,6 +13,7 @@ module Ci
...
@@ -13,6 +13,7 @@ module Ci
scope
:ignore_failures
,
->
()
{
where
(
allow_failure:
false
)
}
scope
:ignore_failures
,
->
()
{
where
(
allow_failure:
false
)
}
scope
:with_artifacts
,
->
()
{
where
.
not
(
artifacts_file:
nil
)
}
scope
:with_artifacts
,
->
()
{
where
.
not
(
artifacts_file:
nil
)
}
scope
:with_expired_artifacts
,
->
()
{
with_artifacts
.
where
(
'artifacts_expire_at < ?'
,
Time
.
now
)
}
scope
:with_expired_artifacts
,
->
()
{
with_artifacts
.
where
(
'artifacts_expire_at < ?'
,
Time
.
now
)
}
scope
:last_month
,
->
()
{
where
(
'created_at > ?'
,
Date
.
today
-
1
.
month
)
}
mount_uploader
:artifacts_file
,
ArtifactUploader
mount_uploader
:artifacts_file
,
ArtifactUploader
mount_uploader
:artifacts_metadata
,
ArtifactUploader
mount_uploader
:artifacts_metadata
,
ArtifactUploader
...
@@ -25,10 +26,6 @@ module Ci
...
@@ -25,10 +26,6 @@ module Ci
after_create
:execute_hooks
after_create
:execute_hooks
class
<<
self
class
<<
self
def
last_month
where
(
'created_at > ?'
,
Date
.
today
-
1
.
month
)
end
def
first_pending
def
first_pending
pending
.
unstarted
.
order
(
'created_at ASC'
).
first
pending
.
unstarted
.
order
(
'created_at ASC'
).
first
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