Add models for the protected branch access levels.
- And hook up their associations.
This commit is contained in:
parent
f1e46d1e63
commit
21bece443d
|
@ -5,6 +5,9 @@ class ProtectedBranch < ActiveRecord::Base
|
||||||
validates :name, presence: true
|
validates :name, presence: true
|
||||||
validates :project, presence: true
|
validates :project, presence: true
|
||||||
|
|
||||||
|
has_one :merge_access_level
|
||||||
|
has_one :push_access_level
|
||||||
|
|
||||||
def commit
|
def commit
|
||||||
project.commit(self.name)
|
project.commit(self.name)
|
||||||
end
|
end
|
||||||
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
class ProtectedBranch::MergeAccessLevel < ActiveRecord::Base
|
||||||
|
belongs_to :protected_branch
|
||||||
|
end
|
|
@ -0,0 +1,3 @@
|
||||||
|
class ProtectedBranch::PushAccessLevel < ActiveRecord::Base
|
||||||
|
belongs_to :protected_branch
|
||||||
|
end
|
Loading…
Reference in New Issue