Class: Account

Inherits:
MLS::Model show all
Includes:
MLS::Avatar, MLS::Slugger
Defined in:
lib/mls/account.rb

Instance Method Summary collapse

Methods included from MLS::Avatar

#avatar_url

Instance Method Details

#company_nameObject



49
50
51
52
# File 'lib/mls/account.rb', line 49

def company_name
  return organization.name if organization
  return company
end

#email_addressObject



33
34
35
36
37
38
39
# File 'lib/mls/account.rb', line 33

def email_address
  if email_addresses.loaded?
    email_addresses.to_a.find{|p| p.primary }.try(:address)
  else
    email_addresses.primary.try(:address)
  end
end

#phoneObject



41
42
43
44
45
46
47
# File 'lib/mls/account.rb', line 41

def phone
  if phones.loaded?
    phones.to_a.find{|p| p.primary }.try(:number)
  else
    phones.primary.try(:number)
  end
end