BigW Consortium Gitlab

protected_branch.rb 581 Bytes
Newer Older
1 2 3 4
# == Schema Information
#
# Table name: protected_branches
#
Dmitriy Zaporozhets committed
5 6 7 8 9 10
#  id                  :integer          not null, primary key
#  project_id          :integer          not null
#  name                :string(255)      not null
#  created_at          :datetime
#  updated_at          :datetime
#  developers_can_push :boolean          default(FALSE), not null
11 12
#

13
class ProtectedBranch < ActiveRecord::Base
14
  include Gitlab::ShellAdapter
15

16
  belongs_to :project
Andrey Kumanyaev committed
17 18
  validates :name, presence: true
  validates :project, presence: true
19 20

  def commit
21
    project.commit(self.name)
22 23
  end
end