Sha256: 554857c3b0a84f1f35f9553caa7769372183ca7370ac0a0fd82275d70ec041e8
Contents?: true
Size: 491 Bytes
Versions: 15
Compression:
Stored size: 491 Bytes
Contents
class ActiveRecord::Base # CarDealer.sales_count -> s_('CarDealer|Sales count') -> 'Sales count' if no translation was found def self.human_attribute_name(attribute, *args) s_(gettext_translation_for_attribute_name(attribute)) end # CarDealer -> _('car dealer') def self.human_name(*args) _(self.to_s.underscore.gsub('_',' ')) end private def self.gettext_translation_for_attribute_name(attribute) "#{self}|#{attribute.to_s.gsub('_',' ').capitalize}" end end
Version data entries
15 entries across 15 versions & 2 rubygems