Sha256: 55872d81e604935a66ccb3bbfcfc485f1defe88aa6871e1385db3082da7bf700
Contents?: true
Size: 497 Bytes
Versions: 28
Compression:
Stored size: 497 Bytes
Contents
module Agilibox::ModelI18n extend ActiveSupport::Concern def t(*args) self.class.t(*args) end def ts self.class.ts end def tv(attribute) value = public_send(attribute) t("#{attribute}.#{value}") if value.present? end class_methods do def t(*args) if args.any? human_attribute_name(*args) else model_name.human end end def ts model_name.human(count: 2) end end # class_methods end # Agilibox::ModelI18n
Version data entries
28 entries across 28 versions & 1 rubygems