summaryrefslogtreecommitdiff
path: root/app/models/ci/event.rb
blob: 8c39be4267767d52a6e69f2f78035a7417001fec (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: ci_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