diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2014-07-30 19:13:35 +0300 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2014-07-30 19:13:35 +0300 |
commit | 2ecc79507a4a9556f6f609c7289b7b0942ccc6bb (patch) | |
tree | 08e52d2656da5e6a06542e422346bb5fcce7be85 /app/models/label.rb | |
parent | 91c1534e59c0492546c46724f9d401c40e1c9133 (diff) | |
download | gitlab-ce-2ecc79507a4a9556f6f609c7289b7b0942ccc6bb.tar.gz |
Order labels by name
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Diffstat (limited to 'app/models/label.rb')
-rw-r--r-- | app/models/label.rb | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/app/models/label.rb b/app/models/label.rb index 5d6e5e91a0c..ce982579675 100644 --- a/app/models/label.rb +++ b/app/models/label.rb @@ -9,6 +9,8 @@ class Label < ActiveRecord::Base # Dont allow '?', '&', and ',' for label titles validates :title, presence: true, format: { with: /\A[^&\?,&]*\z/ } + scope :order_by_name, -> { reorder("labels.title ASC") } + def name title end |