Merge branch 'deploy_keys'
Conflicts: app/views/layouts/project.html.haml db/schema.rb
This commit is contained in:
commit
cbd78922ee
19 changed files with 234 additions and 8 deletions
|
@ -14,6 +14,7 @@ class Project < ActiveRecord::Base
|
|||
has_many :users, :through => :users_projects
|
||||
has_many :notes, :dependent => :destroy
|
||||
has_many :snippets, :dependent => :destroy
|
||||
has_many :deploy_keys, :dependent => :destroy, :foreign_key => "project_id", :class_name => "Key"
|
||||
has_many :web_hooks, :dependent => :destroy
|
||||
|
||||
acts_as_taggable
|
||||
|
@ -199,7 +200,7 @@ class Project < ActiveRecord::Base
|
|||
def repository_readers
|
||||
keys = Key.joins({:user => :users_projects}).
|
||||
where("users_projects.project_id = ? AND users_projects.repo_access = ?", id, Repository::REPO_R)
|
||||
keys.map(&:identifier)
|
||||
keys.map(&:identifier) + deploy_keys.map(&:identifier)
|
||||
end
|
||||
|
||||
def repository_writers
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue