A corporation manager and dashboard for EVE Online
25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

admin_setting.rb 298 B

12345678910111213
  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. self.find_by(key: key).update(value: value)
  9. Rails.cache.write("admin_setting/#{key}", value)
  10. end
  11. end