Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDouglas Barbosa Alexandre <dbalexandre@gmail.com>2016-07-27 22:32:32 +0300
committerDouglas Barbosa Alexandre <dbalexandre@gmail.com>2016-08-17 18:58:57 +0300
commit611dab2e522e5e59cf09cd459a31686e65616863 (patch)
tree85e83a9fef746433ab5cdce643a147bc65f69311 /app/models/list.rb
parentfa576d38bb23e0f2804e3feba959e0c6191dbbb0 (diff)
Add Board model
Diffstat (limited to 'app/models/list.rb')
-rw-r--r--app/models/list.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/app/models/list.rb b/app/models/list.rb
new file mode 100644
index 00000000000..7b347c2255b
--- /dev/null
+++ b/app/models/list.rb
@@ -0,0 +1,10 @@
+class List < ActiveRecord::Base
+ belongs_to :board
+ belongs_to :label
+
+ enum list_type: { label: 0, backlog: 1, done: 2 }
+
+ validates :board, :list_type, :position, presence: true
+ validates :label, presence: true, if: :label?
+ validates :position, numericality: { only_integer: true, greater_than_or_equal_to: 0 }
+end