diff --git a/app/controllers/admin/users_controller.rb b/app/controllers/admin/users_controller.rb index 79838665..4619cb01 100644 --- a/app/controllers/admin/users_controller.rb +++ b/app/controllers/admin/users_controller.rb @@ -34,7 +34,7 @@ class Admin::UsersController < ApplicationController def new - @admin_user = User.new(:projects_limit => 10) + @admin_user = User.new(:projects_limit => GITLAB_OPTS["default_projects_limit"]) end def edit diff --git a/app/models/user.rb b/app/models/user.rb index 60b56627..ccb1dddf 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -90,7 +90,8 @@ class User < ActiveRecord::Base :name => name, :email => email, :password => password, - :password_confirmation => password + :password_confirmation => password, + :projects_limit => GITLAB_OPTS["default_projects_limit"] ) end end diff --git a/config/gitlab.yml.example b/config/gitlab.yml.example index b74082c3..74e841d2 100644 --- a/config/gitlab.yml.example +++ b/config/gitlab.yml.example @@ -31,3 +31,7 @@ git: git_max_size: 5242880 # 5.megabytes # Git timeout to read commit, in seconds git_timeout: 10 + +# Gitlab settings +gitlab: + default_projects_limit: 10 diff --git a/config/initializers/00_before_all.rb b/config/initializers/00_before_all.rb index 96919595..01498804 100644 --- a/config/initializers/00_before_all.rb +++ b/config/initializers/00_before_all.rb @@ -1,3 +1,4 @@ GIT_HOST = YAML.load_file("#{Rails.root}/config/gitlab.yml")["git_host"] EMAIL_OPTS = YAML.load_file("#{Rails.root}/config/gitlab.yml")["email"] GIT_OPTS = YAML.load_file("#{Rails.root}/config/gitlab.yml")["git"] +GITLAB_OPTS = YAML.load_file("#{Rails.root}/config/gitlab.yml")["gitlab"]