From c909b6aa6d62a4c556a866166d0a98c952d2ef62 Mon Sep 17 00:00:00 2001 From: Kamil Trzcinski Date: Thu, 5 Oct 2017 21:56:23 +0200 Subject: Prevent creating multiple ApplicationSetting by forcing it to always have id=1 --- app/models/application_setting.rb | 2 ++ 1 file changed, 2 insertions(+) (limited to 'app') diff --git a/app/models/application_setting.rb b/app/models/application_setting.rb index c0cc60d5ebf..5b5bb3cbe2c 100644 --- a/app/models/application_setting.rb +++ b/app/models/application_setting.rb @@ -33,6 +33,8 @@ class ApplicationSetting < ActiveRecord::Base attr_accessor :domain_whitelist_raw, :domain_blacklist_raw + default_value_for :id, 1 + validates :uuid, presence: true validates :session_expire_delay, -- cgit v1.2.1