Sha256: 376cca8995b85b89027b1726e35376f09276637b667ea01ddef36b2ebd051d0a
Contents?: true
Size: 482 Bytes
Versions: 10
Compression:
Stored size: 482 Bytes
Contents
module Kuztuscms class Settings class << self def set(key, value) Kuztuscms::Setting.create!(:key => key, :value => value) self.clear_cache end def clear_cache @cache = nil end def get(key) unless @cache @cache = Kuztuscms::Setting.all.inject({}) do |res, setting| res[setting.key] = setting.value res end end @cache[key] end end end end
Version data entries
10 entries across 10 versions & 1 rubygems