BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
db79bb17
Commit
db79bb17
authored
Sep 21, 2017
by
Rémy Coutable
Committed by
Robert Speicher
Sep 21, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Merge branch 'events-redundant-where' into 'master'
Remove redundant WHERE from event queries Closes #38129 See merge request gitlab-org/gitlab-ce!14389
parent
59a5b168
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
7 deletions
+12
-7
event.rb
app/models/event.rb
+7
-1
push_event.rb
app/models/push_event.rb
+0
-6
events-redundant-where.yml
changelogs/unreleased/events-redundant-where.yml
+5
-0
No files found.
app/models/event.rb
View file @
db79bb17
class
Event
<
ActiveRecord
::
Base
include
Sortable
include
IgnorableColumn
default_scope
{
reorder
(
nil
)
.
where
.
not
(
author_id:
nil
)
}
default_scope
{
reorder
(
nil
)
}
CREATED
=
1
UPDATED
=
2
...
...
@@ -77,6 +77,12 @@ class Event < ActiveRecord::Base
scope
:for_milestone_id
,
->
(
milestone_id
)
{
where
(
target_type:
"Milestone"
,
target_id:
milestone_id
)
}
# Authors are required as they're used to display who pushed data.
#
# We're just validating the presence of the ID here as foreign key constraints
# should ensure the ID points to a valid user.
validates
:author_id
,
presence:
true
self
.
inheritance_column
=
'action'
# "data" will be removed in 10.0 but it may be possible that JOINs happen that
...
...
app/models/push_event.rb
View file @
db79bb17
...
...
@@ -3,12 +3,6 @@ class PushEvent < Event
# different "action" value.
validate
:validate_push_action
# Authors are required as they're used to display who pushed data.
#
# We're just validating the presence of the ID here as foreign key constraints
# should ensure the ID points to a valid user.
validates
:author_id
,
presence:
true
# The project is required to build links to commits, commit ranges, etc.
#
# We're just validating the presence of the ID here as foreign key constraints
...
...
changelogs/unreleased/events-redundant-where.yml
0 → 100644
View file @
db79bb17
---
title
:
Remove redundant WHERE from event queries
merge_request
:
author
:
type
:
other
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