Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-01-31 11:11:35 +0400
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-01-31 11:11:35 +0400
commit193a5624b2daf4d638c382b88001d06535f57f2d (patch)
tree299193dfe694c776a1fc98c59f0c38565ab7a488
parent563c55eb7e4db988048bd1b2675ee73e0e601402 (diff)
add path and path_with_namespace to api project entity
-rw-r--r--app/models/project.rb2
-rw-r--r--app/models/user.rb2
-rw-r--r--app/models/user_team.rb12
-rw-r--r--app/models/user_team_project_relationship.rb12
-rw-r--r--app/models/user_team_user_relationship.rb13
-rw-r--r--db/migrate/20130131070232_remove_private_flag_from_project.rb9
-rw-r--r--db/schema.rb3
-rw-r--r--doc/api/projects.md6
-rw-r--r--lib/api/entities.rb1
-rw-r--r--spec/factories/user_team_project_relationships.rb12
-rw-r--r--spec/factories/user_team_user_relationships.rb13
-rw-r--r--spec/factories/user_teams.rb12
-rw-r--r--spec/models/project_spec.rb3
-rw-r--r--spec/models/user_spec.rb2
-rw-r--r--spec/models/user_team_project_relationship_spec.rb12
-rw-r--r--spec/models/user_team_spec.rb12
-rw-r--r--spec/models/user_team_user_relationship_spec.rb13
17 files changed, 134 insertions, 5 deletions
diff --git a/app/models/project.rb b/app/models/project.rb
index dde15927808..6a3d7ab15d2 100644
--- a/app/models/project.rb
+++ b/app/models/project.rb
@@ -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"
diff --git a/app/models/user.rb b/app/models/user.rb
index 5a95deec53d..5b0df09a439 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -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
diff --git a/app/models/user_team.rb b/app/models/user_team.rb
index b28a6a041ac..dc8cf9eeb22 100644
--- a/app/models/user_team.rb
+++ b/app/models/user_team.rb
@@ -1,3 +1,15 @@
+# == 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
diff --git a/app/models/user_team_project_relationship.rb b/app/models/user_team_project_relationship.rb
index 1b0368c7ecc..a7aa88970c7 100644
--- a/app/models/user_team_project_relationship.rb
+++ b/app/models/user_team_project_relationship.rb
@@ -1,3 +1,15 @@
+# == 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
diff --git a/app/models/user_team_user_relationship.rb b/app/models/user_team_user_relationship.rb
index 63bdc49e5b6..1f7e2625f5f 100644
--- a/app/models/user_team_user_relationship.rb
+++ b/app/models/user_team_user_relationship.rb
@@ -1,3 +1,16 @@
+# == 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
diff --git a/db/migrate/20130131070232_remove_private_flag_from_project.rb b/db/migrate/20130131070232_remove_private_flag_from_project.rb
new file mode 100644
index 00000000000..5754db11558
--- /dev/null
+++ b/db/migrate/20130131070232_remove_private_flag_from_project.rb
@@ -0,0 +1,9 @@
+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
diff --git a/db/schema.rb b/db/schema.rb
index 144f4a57036..0f07d2bc8c5 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -11,7 +11,7 @@
#
# It's strongly recommended to check this file into your version control system.
-ActiveRecord::Schema.define(:version => 20130125090214) do
+ActiveRecord::Schema.define(:version => 20130131070232) 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
diff --git a/doc/api/projects.md b/doc/api/projects.md
index 411286750f8..82bb0c0d561 100644
--- a/doc/api/projects.md
+++ b/doc/api/projects.md
@@ -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,
diff --git a/lib/api/entities.rb b/lib/api/entities.rb
index 80e2954a344..3637464676b 100644
--- a/lib/api/entities.rb
+++ b/lib/api/entities.rb
@@ -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
diff --git a/spec/factories/user_team_project_relationships.rb b/spec/factories/user_team_project_relationships.rb
index 93c7b57d0fa..e900d86c2e4 100644
--- a/spec/factories/user_team_project_relationships.rb
+++ b/spec/factories/user_team_project_relationships.rb
@@ -1,3 +1,15 @@
+# == 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
diff --git a/spec/factories/user_team_user_relationships.rb b/spec/factories/user_team_user_relationships.rb
index 55179f9a45b..8c729dd8751 100644
--- a/spec/factories/user_team_user_relationships.rb
+++ b/spec/factories/user_team_user_relationships.rb
@@ -1,3 +1,16 @@
+# == 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
diff --git a/spec/factories/user_teams.rb b/spec/factories/user_teams.rb
index f4fe45cbb8a..1a9ae8e885c 100644
--- a/spec/factories/user_teams.rb
+++ b/spec/factories/user_teams.rb
@@ -1,3 +1,15 @@
+# == 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
diff --git a/spec/models/project_spec.rb b/spec/models/project_spec.rb
index 17bc988bf05..6e67ca8233d 100644
--- a/spec/models/project_spec.rb
+++ b/spec/models/project_spec.rb
@@ -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
diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb
index 2ca82edf74e..8ab0a0343bb 100644
--- a/spec/models/user_spec.rb
+++ b/spec/models/user_spec.rb
@@ -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'
diff --git a/spec/models/user_team_project_relationship_spec.rb b/spec/models/user_team_project_relationship_spec.rb
index 81051d59971..86150cf305f 100644
--- a/spec/models/user_team_project_relationship_spec.rb
+++ b/spec/models/user_team_project_relationship_spec.rb
@@ -1,3 +1,15 @@
+# == 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
diff --git a/spec/models/user_team_spec.rb b/spec/models/user_team_spec.rb
index 2d1b99db6f8..76d47f41498 100644
--- a/spec/models/user_team_spec.rb
+++ b/spec/models/user_team_spec.rb
@@ -1,3 +1,15 @@
+# == 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
diff --git a/spec/models/user_team_user_relationship_spec.rb b/spec/models/user_team_user_relationship_spec.rb
index 309f1975e51..981ad1e8873 100644
--- a/spec/models/user_team_user_relationship_spec.rb
+++ b/spec/models/user_team_user_relationship_spec.rb
@@ -1,3 +1,16 @@
+# == 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