A corporation manager and dashboard for EVE Online
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 
 
 
 

17 行
336 B

  1. class AdminSetting < ActiveRecord::Base
  2. def self.get(key)
  3. Rails.cache.fetch("admin_setting/#{key}") do
  4. self.find_by(key: key).value
  5. end
  6. end
  7. def self.set(key, value)
  8. setting = self.find_by(key: key)
  9. setting.update(value: value)
  10. Rails.cache.write("admin_setting/#{key}") do
  11. value
  12. end
  13. end
  14. end