diff options
author | Mario de la Ossa <mdelaossa@gitlab.com> | 2018-02-02 18:39:55 +0000 |
---|---|---|
committer | Sean McGivern <sean@mcgivern.me.uk> | 2018-02-02 18:39:55 +0000 |
commit | eaada9d7066a20b5af815f723e09cde60a5c8c10 (patch) | |
tree | 72ba4231e28f1c5e5405db21e0611a55e6428145 /app/models/key.rb | |
parent | 8fa2932dc5cc7687e7d85ae7b00c07fd9bcc24a4 (diff) | |
download | gitlab-ce-eaada9d7066a20b5af815f723e09cde60a5c8c10.tar.gz |
use Gitlab::UserSettings directly as a singleton instead of including/extending it
Diffstat (limited to 'app/models/key.rb')
-rw-r--r-- | app/models/key.rb | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/app/models/key.rb b/app/models/key.rb index a3f8a5d6dc7..7406c98c99e 100644 --- a/app/models/key.rb +++ b/app/models/key.rb @@ -1,7 +1,6 @@ require 'digest/md5' class Key < ActiveRecord::Base - include Gitlab::CurrentSettings include AfterCommitQueue include Sortable @@ -104,7 +103,7 @@ class Key < ActiveRecord::Base end def key_meets_restrictions - restriction = current_application_settings.key_restriction_for(public_key.type) + restriction = Gitlab::CurrentSettings.key_restriction_for(public_key.type) if restriction == ApplicationSetting::FORBIDDEN_KEY_VALUE errors.add(:key, forbidden_key_type_message) @@ -115,7 +114,7 @@ class Key < ActiveRecord::Base def forbidden_key_type_message allowed_types = - current_application_settings + Gitlab::CurrentSettings .allowed_key_types .map(&:upcase) .to_sentence(last_word_connector: ', or ', two_words_connector: ' or ') |