Module: Enumerative::Enumeration::ClassMethods
- Defined in:
- lib/enumerative/enumeration.rb
Instance Method Summary collapse
Instance Method Details
#to_select ⇒ Object
19 20 21 22 23 |
# File 'lib/enumerative/enumeration.rb', line 19 def to_select valid_keys.sort.collect do |k| [translate( k ), k] end end |
#translate(key) ⇒ Object
25 26 27 28 29 |
# File 'lib/enumerative/enumeration.rb', line 25 def translate( key ) I18n.translate "enumerations.#{name.underscore}.#{key}", :raise => true rescue I18n::MissingTranslationData nil end |