Sha256: 7912d6452df28f30bbe30777af3ea5456cb2614313f0a20653d4988349215df3
Contents?: true
Size: 487 Bytes
Versions: 25
Compression:
Stored size: 487 Bytes
Contents
class AppConfig < ActiveRecord::Base has_many :sitemaps, :as=>:resource after_save :reload before_create :set_name def self.[](name) val = select{|t| t.name==name}[0].try(:value) if val && (val==val.to_i.to_s) val = val.to_i end val end def self.current @current ||= AppConfig.all end def reload AppConfig.instance_variable_set '@current', nil end def set_name self.name = sitemaps[0].try(:menu_text) unless self.name end end
Version data entries
25 entries across 25 versions & 1 rubygems