Class: AppConfig
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- AppConfig
- Defined in:
- app/models/app_config.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.[](name) ⇒ Object
7 8 9 10 11 12 13 |
# File 'app/models/app_config.rb', line 7 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 |
.current ⇒ Object
15 16 17 |
# File 'app/models/app_config.rb', line 15 def self.current @current ||= AppConfig.all end |
Instance Method Details
#reload ⇒ Object
18 19 20 |
# File 'app/models/app_config.rb', line 18 def reload AppConfig.instance_variable_set '@current', nil end |
#set_name ⇒ Object
22 23 24 |
# File 'app/models/app_config.rb', line 22 def set_name self.name = sitemaps[0].try(:menu_text) unless self.name end |