summaryrefslogtreecommitdiff
path: root/app/models/list.rb
diff options
context:
space:
mode:
authorDouglas Barbosa Alexandre <dbalexandre@gmail.com>2016-08-16 14:38:43 -0300
committerDouglas Barbosa Alexandre <dbalexandre@gmail.com>2016-08-17 12:58:59 -0300
commit50ac488c739718902ba897bc5ad8791d35914324 (patch)
treecc3e5cb1b9da7401a5068c510f06e36cdee51f13 /app/models/list.rb
parentc6511235e4253d11447b40c2ea42ecb02c99687e (diff)
downloadgitlab-ce-50ac488c739718902ba897bc5ad8791d35914324.tar.gz
Add a movable scope and a movable? method to List model
Diffstat (limited to 'app/models/list.rb')
-rw-r--r--app/models/list.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/app/models/list.rb b/app/models/list.rb
index 634c012e543..eb87decdbc8 100644
--- a/app/models/list.rb
+++ b/app/models/list.rb
@@ -12,11 +12,16 @@ class List < ActiveRecord::Base
before_destroy :can_be_destroyed
scope :destroyable, -> { where(list_type: list_types[:label]) }
+ scope :movable, -> { where(list_type: list_types[:label]) }
def destroyable?
label?
end
+ def movable?
+ label?
+ end
+
def title
label? ? label.name : list_type.humanize
end