Class: C80Estate::Property

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
app/models/c80_estate/property.rb

Instance Method Summary collapse

Instance Method Details

#assigned_person_titleObject



24
25
26
27
28
29
30
# File 'app/models/c80_estate/property.rb', line 24

def assigned_person_title
  res = "-"
  if assigned_person.present?
    res = assigned_person.email
  end
  res
end

#last_updaterObject



48
49
50
# File 'app/models/c80_estate/property.rb', line 48

def last_updater
  pstats.last.sevent.auser.email
end

#logo_pathObject



32
33
34
35
36
37
38
# File 'app/models/c80_estate/property.rb', line 32

def logo_path
  url = 'property_default_logo.png'
  if plogos.count > 0
    url = plogos.first.image.thumb256
  end
  url
end

#main_image_urlObject



40
41
42
43
44
45
46
# File 'app/models/c80_estate/property.rb', line 40

def main_image_url
  url = 'no_thumb.png'
  if pphotos.count > 0
    url = pphotos.first.image.thumb512
  end
  url
end

#power_price_valueObject



60
61
62
63
64
65
66
# File 'app/models/c80_estate/property.rb', line 60

def power_price_value
  sum = 0
  areas.all.each do |area|
    sum += area.power_price_value
  end
  sum
end

#square_valueObject



52
53
54
55
56
57
58
# File 'app/models/c80_estate/property.rb', line 52

def square_value
  sum = 0
  areas.all.each do |area|
    sum += area.square_value
  end
  sum
end