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
Tatuya Kamada
gitlab-ce
Commits
0badbef8
Commit
0badbef8
authored
Oct 27, 2016
by
Alejandro Rodríguez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Optimize Event queries by removing default order
parent
20a7db44
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
6 additions
and
5 deletions
+6
-5
CHANGELOG.md
CHANGELOG.md
+1
-0
app/models/event.rb
app/models/event.rb
+1
-1
spec/controllers/projects/milestones_controller_spec.rb
spec/controllers/projects/milestones_controller_spec.rb
+1
-1
spec/models/members/project_member_spec.rb
spec/models/members/project_member_spec.rb
+2
-2
spec/services/milestones/close_service_spec.rb
spec/services/milestones/close_service_spec.rb
+1
-1
No files found.
CHANGELOG.md
View file @
0badbef8
...
...
@@ -21,6 +21,7 @@ Please view this file on the master branch, on stable branches it's out of date.
-
Fix typo in framework css class. !7086 (Daniel Voogsgerd)
-
New issue board list dropdown stays open after adding a new list
-
Fix: Backup restore doesn't clear cache
-
Optimize Event queries by removing default order
-
API: Fix project deploy keys 400 and 500 errors when adding an existing key. !6784 (Joshua Welsh)
-
Replace jquery.cookie plugin with js.cookie !7085
-
Use MergeRequestsClosingIssues cache data on Issue#closed_by_merge_requests method
...
...
app/models/event.rb
View file @
0badbef8
class
Event
<
ActiveRecord
::
Base
include
Sortable
default_scope
{
where
.
not
(
author_id:
nil
)
}
default_scope
{
reorder
(
nil
).
where
.
not
(
author_id:
nil
)
}
CREATED
=
1
UPDATED
=
2
...
...
spec/controllers/projects/milestones_controller_spec.rb
View file @
0badbef8
...
...
@@ -20,7 +20,7 @@ describe Projects::MilestonesController do
delete
:destroy
,
namespace_id:
project
.
namespace
.
id
,
project_id:
project
.
id
,
id:
milestone
.
iid
,
format: :js
expect
(
response
).
to
be_success
expect
(
Event
.
first
.
action
).
to
eq
(
Event
::
DESTROYED
)
expect
(
Event
.
recent
.
first
.
action
).
to
eq
(
Event
::
DESTROYED
)
expect
{
Milestone
.
find
(
milestone
.
id
)
}.
to
raise_exception
(
ActiveRecord
::
RecordNotFound
)
issue
.
reload
...
...
spec/models/members/project_member_spec.rb
View file @
0badbef8
...
...
@@ -57,12 +57,12 @@ describe ProjectMember, models: true do
it
"creates an expired event when left due to expiry"
do
expired
=
create
(
:project_member
,
project:
project
,
expires_at:
Time
.
now
-
6
.
days
)
expired
.
destroy
expect
(
Event
.
first
.
action
).
to
eq
(
Event
::
EXPIRED
)
expect
(
Event
.
recent
.
first
.
action
).
to
eq
(
Event
::
EXPIRED
)
end
it
"creates a left event when left due to leave"
do
master
.
destroy
expect
(
Event
.
first
.
action
).
to
eq
(
Event
::
LEFT
)
expect
(
Event
.
recent
.
first
.
action
).
to
eq
(
Event
::
LEFT
)
end
it
"destroys itself and delete associated todos"
do
...
...
spec/services/milestones/close_service_spec.rb
View file @
0badbef8
...
...
@@ -18,7 +18,7 @@ describe Milestones::CloseService, services: true do
it
{
expect
(
milestone
).
to
be_closed
}
describe
:event
do
let
(
:event
)
{
Event
.
first
}
let
(
:event
)
{
Event
.
recent
.
first
}
it
{
expect
(
event
.
milestone
).
to
be_truthy
}
it
{
expect
(
event
.
target
).
to
eq
(
milestone
)
}
...
...
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