debian-mirror-gitlab/app/models/ci/event.rb

28 lines
570 B
Ruby
Raw Normal View History

2015-09-25 12:07:36 +05:30
# == Schema Information
#
2015-11-26 14:37:03 +05:30
# Table name: ci_events
2015-09-25 12:07:36 +05:30
#
# 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