From 603ceea21a0144ff1900106efa0c17e759eeceef Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Mon, 6 Jul 2015 16:47:19 +0200 Subject: Add tests and improve logic Signed-off-by: Dmitriy Zaporozhets --- lib/api/settings.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib/api') diff --git a/lib/api/settings.rb b/lib/api/settings.rb index 4aa81bf8bab..c885fcd7ea3 100644 --- a/lib/api/settings.rb +++ b/lib/api/settings.rb @@ -4,7 +4,8 @@ module API helpers do def current_settings - @current_setting ||= ApplicationSetting.current + @current_setting ||= + (ApplicationSetting.current || ApplicationSetting.create_from_defaults) end end -- cgit v1.2.1