Add models for the protected branch access levels.

- And hook up their associations.
This commit is contained in:
Timothy Andrew 2016-07-05 13:10:42 +05:30
parent f1e46d1e63
commit 21bece443d
3 changed files with 9 additions and 0 deletions

View file

@ -5,6 +5,9 @@ class ProtectedBranch < ActiveRecord::Base
validates :name, presence: true
validates :project, presence: true
has_one :merge_access_level
has_one :push_access_level
def commit
project.commit(self.name)
end

View file

@ -0,0 +1,3 @@
class ProtectedBranch::MergeAccessLevel < ActiveRecord::Base
belongs_to :protected_branch
end

View file

@ -0,0 +1,3 @@
class ProtectedBranch::PushAccessLevel < ActiveRecord::Base
belongs_to :protected_branch
end