Class: C80Estate::Property
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- C80Estate::Property
- Defined in:
- app/models/c80_estate/property.rb
Instance Method Summary collapse
- #assigned_person_title ⇒ Object
- #last_updater ⇒ Object
- #logo_path ⇒ Object
- #main_image_url ⇒ Object
- #power_price_value ⇒ Object
- #square_value ⇒ Object
Instance Method Details
#assigned_person_title ⇒ Object
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_updater ⇒ Object
48 49 50 |
# File 'app/models/c80_estate/property.rb', line 48 def last_updater pstats.last.sevent.auser.email end |
#logo_path ⇒ Object
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_url ⇒ Object
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_value ⇒ Object
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_value ⇒ Object
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 |