2012-11-19 19:24:05 +01:00
|
|
|
# == 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
|
|
|
|
#
|
|
|
|
|
2012-02-15 21:02:33 +01:00
|
|
|
class ProtectedBranch < ActiveRecord::Base
|
2013-01-03 08:06:07 +01:00
|
|
|
include Gitolited
|
2012-08-28 23:04:06 +02:00
|
|
|
|
2012-09-26 20:17:17 +02:00
|
|
|
attr_accessible :name
|
|
|
|
|
2012-02-15 21:02:33 +01:00
|
|
|
belongs_to :project
|
2012-10-09 02:10:04 +02:00
|
|
|
validates :name, presence: true
|
|
|
|
validates :project, presence: true
|
2012-02-15 21:02:33 +01:00
|
|
|
|
|
|
|
def commit
|
2013-01-04 07:43:25 +01:00
|
|
|
project.repository.commit(self.name)
|
2012-02-15 21:02:33 +01:00
|
|
|
end
|
|
|
|
end
|