A corporation manager and dashboard for EVE Online
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

17 lines
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