diff options
author | Sean McGivern <sean@mcgivern.me.uk> | 2017-02-24 11:26:44 +0000 |
---|---|---|
committer | Sean McGivern <sean@mcgivern.me.uk> | 2017-02-24 11:26:44 +0000 |
commit | 806c748852e7d62dfa13fd2d039949ce0f875a12 (patch) | |
tree | ad2142c9c63d3a3aca7d71a048bda460b1767389 /app/models/application_setting.rb | |
parent | a82e3d30b2ef625dae0d2f25324460402f960f09 (diff) | |
parent | f40403cce1a8185254e74dff54ee687b7953093b (diff) | |
download | gitlab-ce-api-remove-owned-groups.tar.gz |
Merge branch 'master' into 'api-remove-owned-groups'api-remove-owned-groups
# Conflicts:
# doc/api/v3_to_v4.md
Diffstat (limited to 'app/models/application_setting.rb')
-rw-r--r-- | app/models/application_setting.rb | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/app/models/application_setting.rb b/app/models/application_setting.rb index 4212f1247cc..dc36c754438 100644 --- a/app/models/application_setting.rb +++ b/app/models/application_setting.rb @@ -76,6 +76,12 @@ class ApplicationSetting < ActiveRecord::Base presence: true, numericality: { only_integer: true, greater_than: 0 } + validates :max_artifacts_size, + presence: true, + numericality: { only_integer: true, greater_than: 0 } + + validates :default_artifacts_expire_in, presence: true, duration: true + validates :container_registry_token_expire_delay, presence: true, numericality: { only_integer: true, greater_than: 0 } @@ -168,6 +174,7 @@ class ApplicationSetting < ActiveRecord::Base after_sign_up_text: nil, akismet_enabled: false, container_registry_token_expire_delay: 5, + default_artifacts_expire_in: '30 days', default_branch_protection: Settings.gitlab['default_branch_protection'], default_project_visibility: Settings.gitlab.default_projects_features['visibility_level'], default_projects_limit: Settings.gitlab['default_projects_limit'], @@ -201,9 +208,9 @@ class ApplicationSetting < ActiveRecord::Base sign_in_text: nil, signin_enabled: Settings.gitlab['signin_enabled'], signup_enabled: Settings.gitlab['signup_enabled'], + terminal_max_session_time: 0, two_factor_grace_period: 48, - user_default_external: false, - terminal_max_session_time: 0 + user_default_external: false } end @@ -215,6 +222,14 @@ class ApplicationSetting < ActiveRecord::Base create(defaults) end + def self.human_attribute_name(attr, _options = {}) + if attr == :default_artifacts_expire_in + 'Default artifacts expiration' + else + super + end + end + def home_page_url_column_exist ActiveRecord::Base.connection.column_exists?(:application_settings, :home_page_url) end |