Class: Property

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

Instance Method Summary collapse

Methods included from MLS::Avatar

#avatar_url

Methods included from MLS::Slugger

#to_param

Instance Method Details

#default_contactObject



17
18
19
20
21
22
# File 'lib/mls/property.rb', line 17

def default_contact
  @default_contact ||= listings.where(lease_state: :listed, ghost: false, authorized: true)
          .where({ type: ['Lease', 'Sublease']})
          .order(size: :desc)
          .first.try(:contact)
end