Class: CabooseRets::OpenHouse

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
app/models/caboose_rets/open_house.rb

Instance Method Summary collapse

Instance Method Details

#agentObject

def property

models = [CabooseRets::Property]
models.each do |model|
  id = self.mls_acct.to_i
  return model.find(id) if model.exists?(id)
end
return nil

end



17
18
19
20
# File 'app/models/caboose_rets/open_house.rb', line 17

def agent
  return CabooseRets::Agent.where(:mls_id => self.mls_id).first if CabooseRets::Agent.exists?(:mls_id => self.mls_id)
  return nil
end

#parse(data) ⇒ Object



22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'app/models/caboose_rets/open_house.rb', line 22

def parse(data)
  #    self.active_yn          = data['ActiveYN']
      self.description        = data['OpenHouseRemarks']
      self.end_time           = data['OpenHouseEndTime']
   #   self.entry_order        = data['EntryOrder']
   #
      self.listing_mui        = data['ListingId']
      self.matrix_unique_id   = data['OpenHouseKey']
      self.matrix_modified_dt = data['ModificationTimestamp']
      self.open_house_date    = data['OpenHouseDate']
      self.open_house_type    = data['OpenHouseType']
      self.provider_key       = data['ShowingAgentKey']
      self.refreshments       = data['Refrehments']
      self.start_time         = data['OpenHouseStartTime'] 
end