Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class ApplicationRecord < ActiveRecord::Base
- self.abstract_class = true
- def self.human_enum_name(enum_name, enum_value)
- enum_i18n_key = enum_name.to_s.pluralize
- I18n.t("activerecord.attributes.#{model_name.i18n_key}.#{enum_i18n_key}.#{enum_value}")
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement