BigW Consortium Gitlab

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

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

15 16
  attr_accessible :name

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

  def commit
22
    project.repository.commit(self.name)
23 24
  end
end