mirror of
https://github.com/wahyd4/gitlabhq.git
synced 2026-08-16 08:06:08 +10:00
Merge branch 'api-sort-merge-request-comments' into 'master'
Api: sort merge_request comments
Add default_scope { order(created_at: :asc, id: :asc) } in Note so comments are sorted when fetched through api.
See merge request !256
This commit is contained in:
@@ -44,6 +44,7 @@ class Note < ActiveRecord::Base
|
||||
mount_uploader :attachment, AttachmentUploader
|
||||
|
||||
# Scopes
|
||||
default_scope { order(created_at: :asc, id: :asc) }
|
||||
scope :for_commit_id, ->(commit_id) { where(noteable_type: "Commit", commit_id: commit_id) }
|
||||
scope :inline, ->{ where("line_code IS NOT NULL") }
|
||||
scope :not_inline, ->{ where(line_code: [nil, '']) }
|
||||
|
||||
Reference in New Issue
Block a user