Class: ZeActiontype
- Inherits:
-
ZlookupCached
- Object
- Zlookup
- ZlookupCached
- ZeActiontype
- Defined in:
- app/models/ze_actiontype.rb
Class Method Summary collapse
-
.type_descriptions ⇒ Object
This method caches the ZeActiontype ids and their descriptions.
Methods inherited from Zlookup
Class Method Details
.type_descriptions ⇒ Object
This method caches the ZeActiontype ids and their descriptions. With the new class loader of Rails 2.2 and later, we cannot prepopulate a constant with this data (as we did in Rails 1.2 and 2.1). Instead, we cache the result in the model.
8 9 10 11 12 |
# File 'app/models/ze_actiontype.rb', line 8 def self.type_descriptions @@type_descriptions ||= all.inject({}) do |hash, l| hash.merge!(l.id.to_sym => l.shortdesc) end end |