Module: Homeschool::ModelExtensions::ClassMethods
- Defined in:
- lib/model_extensions.rb
Instance Method Summary collapse
Instance Method Details
#human_field_names(hash = nil) ⇒ Object
3 4 5 6 |
# File 'lib/model_extensions.rb', line 3 def human_field_names(hash=nil) @human_field_names = hash if hash @human_field_names || {} end |
#human_name(field) ⇒ Object
8 9 10 |
# File 'lib/model_extensions.rb', line 8 def human_name(field) human_field_names[field.to_sym] || field.to_s.titleize end |