Sha256: 5d0d0a7f87c6583c64a24d0934e1b1cc8a0c3edb7c317b26759c8b925da2f750

Contents?: true

Size: 479 Bytes

Versions: 38

Compression:

Stored size: 479 Bytes

Contents

class Person < ActiveRecord::Base
  belongs_to :gender
  
  def complete_name
    # Dr. Edwin E. 'Buzz' Aldrin Jr.

    self.nick_name.blank? ? nick_name = nil : nick_name = "'#{self.nick_name}'"
    self.middle_name.blank? ? middle_name = nil : middle_name = "#{self.middle_name.first.upcase}."
    [
      self.personal_title,
      self.first_name,
      middle_name,
      nick_name,
      self.last_name,
      self.suffix
    ].delete_if{|i| i.blank? }.join(' ')
  end
end

Version data entries

38 entries across 38 versions & 1 rubygems

Version Path
reso-0.1.6.7 app/models/person.rb
reso-0.1.6.6 app/models/person.rb
reso-0.1.6.5 app/models/person.rb
reso-0.1.6.4 app/models/person.rb
reso-0.1.6.3 app/models/person.rb
reso-0.1.6.2 app/models/person.rb
reso-0.1.6.1 app/models/person.rb
reso-0.1.6 app/models/person.rb
reso-0.1.5.11 app/models/person.rb
reso-0.1.5.10 app/models/person.rb
reso-0.1.5.9 app/models/person.rb
reso-0.1.5.7 app/models/person.rb
reso-0.1.5.6 app/models/person.rb
reso-0.1.5.5 app/models/person.rb
reso-0.1.5.4 app/models/person.rb
reso-0.1.5.3 app/models/person.rb
reso-0.1.5.2 app/models/person.rb
reso-0.1.5.1 app/models/person.rb
reso-0.1.5.0 app/models/person.rb
reso-0.1.4.10 app/models/person.rb