Class: ZeActiontype

Inherits:
ZlookupCached show all
Defined in:
app/models/ze_actiontype.rb

Class Method Summary collapse

Methods inherited from Zlookup

valid_value?

Class Method Details

.type_descriptionsObject

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