Module: NameableRecord::ActiveRecordExtensions::ActsMethods
- Defined in:
- lib/nameable_record/active_record_extensions.rb
Instance Method Summary collapse
- #has_name(*args) ⇒ Object (also: #has_names)
Instance Method Details
#has_name(*args) ⇒ Object Also known as: has_names
9 10 11 12 13 14 15 16 17 |
# File 'lib/nameable_record/active_record_extensions.rb', line 9 def has_name( *args ) args.each do |attr| composed_of attr, :class_name => "NameableRecord::Name", :mapping => [["#{attr}_last", "last"], ["#{attr}_first", "first"], ["#{attr}_prefix", "prefix"], ["#{attr}_middle", "middle"], ["#{attr}_suffix", "suffix"]] end end |