From 9934d320fec24df51161964e9f1e180cb7d8f3d3 Mon Sep 17 00:00:00 2001 From: gms-gs Date: Wed, 20 Nov 2024 13:34:57 +0000 Subject: [PATCH] Move SiteSetting class to lib dir --- app/models/site_setting.rb | 13 ------------- {app/models => lib}/find/site_setting.rb | 2 ++ 2 files changed, 2 insertions(+), 13 deletions(-) delete mode 100644 app/models/site_setting.rb rename {app/models => lib}/find/site_setting.rb (86%) diff --git a/app/models/site_setting.rb b/app/models/site_setting.rb deleted file mode 100644 index 36d57120d8..0000000000 --- a/app/models/site_setting.rb +++ /dev/null @@ -1,13 +0,0 @@ -# frozen_string_literal: true - -require './config/initializers/redis' - -class SiteSetting < ApplicationRecord - def self.cycle_schedule - RedisClient.current.get('cycle_schedule')&.to_sym || :real - end - - def self.set(name:, value:) - RedisClient.current.set(name, value) - end -end diff --git a/app/models/find/site_setting.rb b/lib/find/site_setting.rb similarity index 86% rename from app/models/find/site_setting.rb rename to lib/find/site_setting.rb index 3404baa93e..1ae42d3490 100644 --- a/app/models/find/site_setting.rb +++ b/lib/find/site_setting.rb @@ -1,5 +1,7 @@ # frozen_string_literal: true +require './config/initializers/redis' + module Find class SiteSetting def self.cycle_schedule