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
Jérome Perrin
gitlab-ce
Commits
193a5624
Commit
193a5624
authored
Jan 31, 2013
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add path and path_with_namespace to api project entity
parent
563c55eb
Changes
17
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
134 additions
and
5 deletions
+134
-5
app/models/project.rb
app/models/project.rb
+1
-1
app/models/user.rb
app/models/user.rb
+2
-0
app/models/user_team.rb
app/models/user_team.rb
+12
-0
app/models/user_team_project_relationship.rb
app/models/user_team_project_relationship.rb
+12
-0
app/models/user_team_user_relationship.rb
app/models/user_team_user_relationship.rb
+13
-0
db/migrate/20130131070232_remove_private_flag_from_project.rb
...igrate/20130131070232_remove_private_flag_from_project.rb
+9
-0
db/schema.rb
db/schema.rb
+1
-2
doc/api/projects.md
doc/api/projects.md
+6
-0
lib/api/entities.rb
lib/api/entities.rb
+1
-0
spec/factories/user_team_project_relationships.rb
spec/factories/user_team_project_relationships.rb
+12
-0
spec/factories/user_team_user_relationships.rb
spec/factories/user_team_user_relationships.rb
+13
-0
spec/factories/user_teams.rb
spec/factories/user_teams.rb
+12
-0
spec/models/project_spec.rb
spec/models/project_spec.rb
+1
-2
spec/models/user_spec.rb
spec/models/user_spec.rb
+2
-0
spec/models/user_team_project_relationship_spec.rb
spec/models/user_team_project_relationship_spec.rb
+12
-0
spec/models/user_team_spec.rb
spec/models/user_team_spec.rb
+12
-0
spec/models/user_team_user_relationship_spec.rb
spec/models/user_team_user_relationship_spec.rb
+13
-0
No files found.
app/models/project.rb
View file @
193a5624
...
...
@@ -8,7 +8,6 @@
# description :text
# created_at :datetime not null
# updated_at :datetime not null
# private_flag :boolean default(TRUE), not null
# creator_id :integer
# default_branch :string(255)
# issues_enabled :boolean default(TRUE), not null
...
...
@@ -16,6 +15,7 @@
# merge_requests_enabled :boolean default(TRUE), not null
# wiki_enabled :boolean default(TRUE), not null
# namespace_id :integer
# public :boolean default(FALSE), not null
#
require
"grit"
...
...
app/models/user.rb
View file @
193a5624
...
...
@@ -31,6 +31,8 @@
# extern_uid :string(255)
# provider :string(255)
# username :string(255)
# can_create_group :boolean default(TRUE), not null
# can_create_team :boolean default(TRUE), not null
#
class
User
<
ActiveRecord
::
Base
...
...
app/models/user_team.rb
View file @
193a5624
# == Schema Information
#
# Table name: user_teams
#
# id :integer not null, primary key
# name :string(255)
# path :string(255)
# owner_id :integer
# created_at :datetime not null
# updated_at :datetime not null
#
class
UserTeam
<
ActiveRecord
::
Base
attr_accessible
:name
,
:owner_id
,
:path
...
...
app/models/user_team_project_relationship.rb
View file @
193a5624
# == Schema Information
#
# Table name: user_team_project_relationships
#
# id :integer not null, primary key
# project_id :integer
# user_team_id :integer
# greatest_access :integer
# created_at :datetime not null
# updated_at :datetime not null
#
class
UserTeamProjectRelationship
<
ActiveRecord
::
Base
attr_accessible
:greatest_access
,
:project_id
,
:user_team_id
...
...
app/models/user_team_user_relationship.rb
View file @
193a5624
# == Schema Information
#
# Table name: user_team_user_relationships
#
# id :integer not null, primary key
# user_id :integer
# user_team_id :integer
# group_admin :boolean
# permission :integer
# created_at :datetime not null
# updated_at :datetime not null
#
class
UserTeamUserRelationship
<
ActiveRecord
::
Base
attr_accessible
:group_admin
,
:permission
,
:user_id
,
:user_team_id
...
...
db/migrate/20130131070232_remove_private_flag_from_project.rb
0 → 100644
View file @
193a5624
class
RemovePrivateFlagFromProject
<
ActiveRecord
::
Migration
def
up
remove_column
:projects
,
:private_flag
end
def
down
add_column
:projects
,
:private_flag
,
:boolean
,
default:
true
,
null:
false
end
end
db/schema.rb
View file @
193a5624
...
...
@@ -11,7 +11,7 @@
#
# It's strongly recommended to check this file into your version control system.
ActiveRecord
::
Schema
.
define
(
:version
=>
201301
25090214
)
do
ActiveRecord
::
Schema
.
define
(
:version
=>
201301
31070232
)
do
create_table
"events"
,
:force
=>
true
do
|
t
|
t
.
string
"target_type"
...
...
@@ -147,7 +147,6 @@ ActiveRecord::Schema.define(:version => 20130125090214) do
t
.
text
"description"
t
.
datetime
"created_at"
,
:null
=>
false
t
.
datetime
"updated_at"
,
:null
=>
false
t
.
boolean
"private_flag"
,
:default
=>
true
,
:null
=>
false
t
.
integer
"creator_id"
t
.
string
"default_branch"
t
.
boolean
"issues_enabled"
,
:default
=>
true
,
:null
=>
false
...
...
doc/api/projects.md
View file @
193a5624
...
...
@@ -22,6 +22,8 @@ GET /projects
"created_at"
:
"2012-05-23T08:00:58Z"
},
"private"
:
true
,
"path"
:
"rails"
,
"path_with_namespace"
:
"rails/rails"
,
"issues_enabled"
:
false
,
"merge_requests_enabled"
:
false
,
"wall_enabled"
:
true
,
...
...
@@ -42,6 +44,8 @@ GET /projects
"created_at"
:
"2012-05-23T08:00:58Z"
},
"private"
:
true
,
"path"
:
"gitlab"
,
"path_with_namespace"
:
"randx/gitlab"
,
"issues_enabled"
:
true
,
"merge_requests_enabled"
:
true
,
"wall_enabled"
:
true
,
...
...
@@ -78,6 +82,8 @@ Parameters:
"created_at"
:
"2012-05-23T08:00:58Z"
},
"private"
:
true
,
"path"
:
"gitlab"
,
"path_with_namespace"
:
"randx/gitlab"
,
"issues_enabled"
:
true
,
"merge_requests_enabled"
:
true
,
"wall_enabled"
:
true
,
...
...
lib/api/entities.rb
View file @
193a5624
...
...
@@ -21,6 +21,7 @@ module Gitlab
expose
:id
,
:name
,
:description
,
:default_branch
expose
:owner
,
using:
Entities
::
UserBasic
expose
:private_flag
,
as: :private
expose
:path
,
:path_with_namespace
expose
:issues_enabled
,
:merge_requests_enabled
,
:wall_enabled
,
:wiki_enabled
,
:created_at
expose
:namespace
end
...
...
spec/factories/user_team_project_relationships.rb
View file @
193a5624
# == Schema Information
#
# Table name: user_team_project_relationships
#
# id :integer not null, primary key
# project_id :integer
# user_team_id :integer
# greatest_access :integer
# created_at :datetime not null
# updated_at :datetime not null
#
# Read about factories at https://github.com/thoughtbot/factory_girl
FactoryGirl
.
define
do
...
...
spec/factories/user_team_user_relationships.rb
View file @
193a5624
# == Schema Information
#
# Table name: user_team_user_relationships
#
# id :integer not null, primary key
# user_id :integer
# user_team_id :integer
# group_admin :boolean
# permission :integer
# created_at :datetime not null
# updated_at :datetime not null
#
# Read about factories at https://github.com/thoughtbot/factory_girl
FactoryGirl
.
define
do
...
...
spec/factories/user_teams.rb
View file @
193a5624
# == Schema Information
#
# Table name: user_teams
#
# id :integer not null, primary key
# name :string(255)
# path :string(255)
# owner_id :integer
# created_at :datetime not null
# updated_at :datetime not null
#
# Read about factories at https://github.com/thoughtbot/factory_girl
FactoryGirl
.
define
do
...
...
spec/models/project_spec.rb
View file @
193a5624
...
...
@@ -8,7 +8,6 @@
# description :text
# created_at :datetime not null
# updated_at :datetime not null
# private_flag :boolean default(TRUE), not null
# creator_id :integer
# default_branch :string(255)
# issues_enabled :boolean default(TRUE), not null
...
...
@@ -16,6 +15,7 @@
# merge_requests_enabled :boolean default(TRUE), not null
# wiki_enabled :boolean default(TRUE), not null
# namespace_id :integer
# public :boolean default(FALSE), not null
#
require
'spec_helper'
...
...
@@ -42,7 +42,6 @@ describe Project do
describe
"Mass assignment"
do
it
{
should_not
allow_mass_assignment_of
(
:namespace_id
)
}
it
{
should_not
allow_mass_assignment_of
(
:creator_id
)
}
it
{
should_not
allow_mass_assignment_of
(
:private_flag
)
}
end
describe
"Validation"
do
...
...
spec/models/user_spec.rb
View file @
193a5624
...
...
@@ -31,6 +31,8 @@
# extern_uid :string(255)
# provider :string(255)
# username :string(255)
# can_create_group :boolean default(TRUE), not null
# can_create_team :boolean default(TRUE), not null
#
require
'spec_helper'
...
...
spec/models/user_team_project_relationship_spec.rb
View file @
193a5624
# == Schema Information
#
# Table name: user_team_project_relationships
#
# id :integer not null, primary key
# project_id :integer
# user_team_id :integer
# greatest_access :integer
# created_at :datetime not null
# updated_at :datetime not null
#
require
'spec_helper'
describe
UserTeamProjectRelationship
do
...
...
spec/models/user_team_spec.rb
View file @
193a5624
# == Schema Information
#
# Table name: user_teams
#
# id :integer not null, primary key
# name :string(255)
# path :string(255)
# owner_id :integer
# created_at :datetime not null
# updated_at :datetime not null
#
require
'spec_helper'
describe
UserTeam
do
...
...
spec/models/user_team_user_relationship_spec.rb
View file @
193a5624
# == Schema Information
#
# Table name: user_team_user_relationships
#
# id :integer not null, primary key
# user_id :integer
# user_team_id :integer
# group_admin :boolean
# permission :integer
# created_at :datetime not null
# updated_at :datetime not null
#
require
'spec_helper'
describe
UserTeamUserRelationship
do
...
...
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