summaryrefslogtreecommitdiff
path: root/app/services
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-01-08 09:53:35 -0800
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-01-08 09:53:35 -0800
commit57a65ede77b7bbae6e3b2a7aa52135de7b0c2f8e (patch)
tree3f1d72a04c3deefb8a911d013e686b036541af60 /app/services
parent8589b4e137f50293952923bb07e2814257d7784d (diff)
downloadgitlab-ce-57a65ede77b7bbae6e3b2a7aa52135de7b0c2f8e.tar.gz
Improve application settings and write tests
Diffstat (limited to 'app/services')
-rw-r--r--app/services/base_service.rb6
-rw-r--r--app/services/gravatar_service.rb4
2 files changed, 9 insertions, 1 deletions
diff --git a/app/services/base_service.rb b/app/services/base_service.rb
index 0d46eeaa18f..bb51795df7c 100644
--- a/app/services/base_service.rb
+++ b/app/services/base_service.rb
@@ -1,4 +1,6 @@
class BaseService
+ include Gitlab::CurrentSettings
+
attr_accessor :project, :current_user, :params
def initialize(project, user, params = {})
@@ -29,6 +31,10 @@ class BaseService
SystemHooksService.new
end
+ def current_application_settings
+ ApplicationSetting.current
+ end
+
private
def error(message)
diff --git a/app/services/gravatar_service.rb b/app/services/gravatar_service.rb
index d8c9436aaa5..4bee0c26a68 100644
--- a/app/services/gravatar_service.rb
+++ b/app/services/gravatar_service.rb
@@ -1,6 +1,8 @@
class GravatarService
+ include Gitlab::CurrentSettings
+
def execute(email, size = nil)
- if ApplicationSetting.current.gravatar_enabled && email.present?
+ if current_application_settings.gravatar_enabled? && email.present?
size = 40 if size.nil? || size <= 0
sprintf gravatar_url,