Class: Individual

Inherits:
Person
  • Object
show all
Defined in:
app/models/individual.rb

Instance Attribute Summary

Attributes inherited from Person

#skip_commit, #skip_sync_to_mailchimp

Instance Method Summary collapse

Methods inherited from Person

#add_phone_if_missing, #any_current_passes?, companies, #company?, create_dummy_for, #create_subscribed_lists_notes!, #default_to_individual, #destroyable?, dummy_for, #dupe_code, find_by_email_and_organization, find_by_import, find_by_organization, find_dupes_in, find_or_create, first_or_create, first_or_initialize, #has_nothing?, #has_something?, in_household, #individual?, individuals, mergables, merge, #new_note, not_in_household, #phone_missing?, #possessive, #previous_changes_sentence, recent, #relationships_of_relation, #send_pass_summary_email, #starred_actions, #unstarred_actions, #update_address, #update_from_import, #update_name, #validate_naming_details

Methods included from Ext::DelayedIndexing

included

Methods included from Valuation::LifetimeMemberships

#calculate_lifetime_memberships, #lifetime_orders

Methods included from Valuation::LifetimeDonations

#calculate_lifetime_donations, #lifetime_orders

Methods included from Valuation::LifetimeTicketValue

#calculate_lifetime_ticket_value, #lifetime_orders

Methods included from Valuation::LifetimeValue

#calculate_lifetime_value, #lifetime_orders

Methods included from OhNoes::Destroy

#destroy, #destroyable?

Instance Method Details

#naming_details_available?Boolean

Returns:

  • (Boolean)


17
18
19
# File 'app/models/individual.rb', line 17

def naming_details_available?
  first_name.present? || last_name.present? || email.present?
end

#to_sObject



5
6
7
8
9
10
11
12
13
14
15
# File 'app/models/individual.rb', line 5

def to_s
  if first_name.present? || last_name.present?
    [salutation, first_name, middle_name, last_name, suffix].reject(&:blank?).join(" ")
  elsif email.present?
    email.to_s
  elsif id.present?
    "No Name ##{id}"
  else
    "No Name"
  end
end