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
Kazuhiko Shiozaki
gitlab-ce
Commits
e0aa5c37
Commit
e0aa5c37
authored
Feb 05, 2015
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix method overlap for issue sorting
parent
62ed1c53
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
5 additions
and
3 deletions
+5
-3
app/models/concerns/internal_id.rb
app/models/concerns/internal_id.rb
+0
-1
app/models/concerns/sortable.rb
app/models/concerns/sortable.rb
+2
-2
app/models/issue.rb
app/models/issue.rb
+1
-0
app/models/merge_request.rb
app/models/merge_request.rb
+1
-0
app/models/milestone.rb
app/models/milestone.rb
+1
-0
No files found.
app/models/concerns/internal_id.rb
View file @
e0aa5c37
module
InternalId
extend
ActiveSupport
::
Concern
include
Sortable
included
do
validate
:set_iid
,
on: :create
...
...
app/models/concerns/sortable.rb
View file @
e0aa5c37
...
...
@@ -17,7 +17,7 @@ module Sortable
end
module
ClassMethods
def
sort
(
method
)
def
order_by
(
method
)
case
method
.
to_s
when
'name'
then
order_name_asc
when
'recent'
then
order_recent
...
...
@@ -25,7 +25,7 @@ module Sortable
when
'recent_updated'
then
order_recent_updated
when
'oldest_updated'
then
order_oldest_updated
else
self
all
end
end
end
...
...
app/models/issue.rb
View file @
e0aa5c37
...
...
@@ -24,6 +24,7 @@ class Issue < ActiveRecord::Base
include
Issuable
include
InternalId
include
Taskable
include
Sortable
ActsAsTaggableOn
.
strict_case_match
=
true
...
...
app/models/merge_request.rb
View file @
e0aa5c37
...
...
@@ -28,6 +28,7 @@ class MergeRequest < ActiveRecord::Base
include
Issuable
include
Taskable
include
InternalId
include
Sortable
belongs_to
:target_project
,
foreign_key: :target_project_id
,
class_name:
"Project"
belongs_to
:source_project
,
foreign_key: :source_project_id
,
class_name:
"Project"
...
...
app/models/milestone.rb
View file @
e0aa5c37
...
...
@@ -15,6 +15,7 @@
class
Milestone
<
ActiveRecord
::
Base
include
InternalId
include
Sortable
belongs_to
:project
has_many
:issues
...
...
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