# 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
# 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"
# 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
+# == 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
+# == 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
+# == 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
--- /dev/null
+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
#
# 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"
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
"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,
"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,
"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,
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
+# == 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
+# == 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
+# == 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
# 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
# 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'
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
# 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'
+# == 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
+# == 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
+# == 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