lib/yodeler/models/notification.rb in yodeler-0.0.6 vs lib/yodeler/models/notification.rb in yodeler-0.0.7

- old
+ new

@@ -11,9 +11,18 @@ def message I18n.t("yodeler.event_types.#{event_type_key}.message", event.payload) end + def name + I18n.t("yodeler.event_types.#{event_type_key}.name", event.payload) + end + + def state + state_enum_value = read_attribute :state + event_type.class.configuration.states.key(state_enum_value) + end + protected def event_type_key event_type.name.to_sym end end \ No newline at end of file