Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
iv
gitlab-ce
Commits
b8b6515f
Commit
b8b6515f
authored
Dec 31, 2011
by
miks
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Renamed project "keys" back to "deploy_keys"
parent
99b8b577
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
10 deletions
+10
-10
app/controllers/deploy_keys_controller.rb
app/controllers/deploy_keys_controller.rb
+5
-5
app/models/project.rb
app/models/project.rb
+5
-5
No files found.
app/controllers/deploy_keys_controller.rb
View file @
b8b6515f
...
...
@@ -12,28 +12,28 @@ class DeployKeysController < ApplicationController
end
def
index
@keys
=
@project
.
keys
.
all
@keys
=
@project
.
deploy_
keys
.
all
end
def
show
@key
=
@project
.
keys
.
find
(
params
[
:id
])
@key
=
@project
.
deploy_
keys
.
find
(
params
[
:id
])
end
def
new
@key
=
@project
.
keys
.
new
@key
=
@project
.
deploy_
keys
.
new
respond_with
(
@key
)
end
def
create
@key
=
@project
.
keys
.
new
(
params
[
:key
])
@key
=
@project
.
deploy_
keys
.
new
(
params
[
:key
])
@key
.
save
respond_with
(
@key
)
end
def
destroy
@key
=
@project
.
keys
.
find
(
params
[
:id
])
@key
=
@project
.
deploy_
keys
.
find
(
params
[
:id
])
@key
.
destroy
respond_to
do
|
format
|
...
...
app/models/project.rb
View file @
b8b6515f
...
...
@@ -14,7 +14,7 @@ class Project < ActiveRecord::Base
has_many
:users
,
:through
=>
:users_projects
has_many
:notes
,
:dependent
=>
:destroy
has_many
:snippets
,
:dependent
=>
:destroy
has_many
:
keys
,
:dependent
=>
:destroy
has_many
:
deploy_keys
,
:dependent
=>
:destroy
,
:foreign_key
=>
"project_id"
,
:class_name
=>
"Key"
has_many
:web_hooks
,
:dependent
=>
:destroy
acts_as_taggable
...
...
@@ -189,15 +189,15 @@ class Project < ActiveRecord::Base
end
def
repository_readers
read_
keys
=
Key
.
joins
({
:user
=>
:users_projects
}).
keys
=
Key
.
joins
({
:user
=>
:users_projects
}).
where
(
"users_projects.project_id = ? AND users_projects.repo_access = ?"
,
id
,
Repository
::
REPO_R
)
read_keys
.
map
(
&
:identifier
)
+
keys
.
map
(
&
:identifier
)
keys
.
map
(
&
:identifier
)
+
deploy_
keys
.
map
(
&
:identifier
)
end
def
repository_writers
write_
keys
=
Key
.
joins
({
:user
=>
:users_projects
}).
keys
=
Key
.
joins
({
:user
=>
:users_projects
}).
where
(
"users_projects.project_id = ? AND users_projects.repo_access = ?"
,
id
,
Repository
::
REPO_RW
)
write_
keys
.
map
(
&
:identifier
)
keys
.
map
(
&
:identifier
)
end
def
readers
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment