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

event.rb « ci « models « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: cac3a7a49c1222f1bb91da463e38590ab89176c3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# == Schema Information
#
# Table name: events
#
#  id          :integer          not null, primary key
#  project_id  :integer
#  user_id     :integer
#  is_admin    :integer
#  description :text
#  created_at  :datetime
#  updated_at  :datetime
#

module Ci
  class Event < ActiveRecord::Base
    extend Ci::Model
    
    belongs_to :project, class_name: 'Ci::Project'

    validates :description,
      presence: true,
      length: { in: 5..200 }

    scope :admin, ->(){ where(is_admin: true) }
    scope :project_wide, ->(){ where(is_admin: false) }
  end
end