Module: TableSalt::ClassMethods

Defined in:
lib/table_salt.rb

Instance Method Summary collapse

Instance Method Details

#human_attribute_name(attr) ⇒ Object



58
59
60
61
62
63
64
# File 'lib/table_salt.rb', line 58

def human_attribute_name( attr )
  name = I18n.translate( "activerecord.attributes.#{self.name.underscore}.#{attr}" )

  name.include?( 'translation missing: ' ) ?
    attr.to_s.humanize :
    name
end