Commit 97d74c2adc71a9144840573d87a796dc46cc2511

Authored by Pierre GUINOISEAU
1 parent 335f9d64

Add configurable default for projects_limit

app/controllers/admin/users_controller.rb
... ... @@ -34,7 +34,7 @@ class Admin::UsersController < ApplicationController
34 34  
35 35  
36 36 def new
37   - @admin_user = User.new(:projects_limit => 10)
  37 + @admin_user = User.new(:projects_limit => GITLAB_OPTS["default_projects_limit"])
38 38 end
39 39  
40 40 def edit
... ...
app/models/user.rb
... ... @@ -90,7 +90,8 @@ class User < ActiveRecord::Base
90 90 :name => name,
91 91 :email => email,
92 92 :password => password,
93   - :password_confirmation => password
  93 + :password_confirmation => password,
  94 + :projects_limit => GITLAB_OPTS["default_projects_limit"]
94 95 )
95 96 end
96 97 end
... ...
config/gitlab.yml.example
... ... @@ -27,3 +27,7 @@ git:
27 27 git_max_size: 5242880 # 5.megabytes
28 28 # Git timeout to read commit, in seconds
29 29 git_timeout: 10
  30 +
  31 +# Gitlab settings
  32 +gitlab:
  33 + default_projects_limit: 10
... ...
config/initializers/00_before_all.rb
1 1 GIT_HOST = YAML.load_file("#{Rails.root}/config/gitlab.yml")["git_host"]
2 2 EMAIL_OPTS = YAML.load_file("#{Rails.root}/config/gitlab.yml")["email"]
3 3 GIT_OPTS = YAML.load_file("#{Rails.root}/config/gitlab.yml")["git"]
  4 +GITLAB_OPTS = YAML.load_file("#{Rails.root}/config/gitlab.yml")["gitlab"]
... ...