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