Module: C80Estate::AppHelper

Defined in:
app/helpers/c80_estate/app_helper.rb

Instance Method Summary collapse

Instance Method Details

#render_table_prop_busy_coef(atype_id: nil) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'app/helpers/c80_estate/app_helper.rb', line 4

def render_table_prop_busy_coef(atype_id: nil)
  # Rails.logger.debug "<render_table_prop_busy_coef> atype_id = #{atype_id}"

  props = Property.all
  list = []

  props.all.each do |prop|
    pp = Pstat.busy_coef(prop_id: prop.id, atype_id: atype_id)
    # Rails.logger.debug "<render_table_prop_busy_coef> pp = #{pp}"
    busy_coef = pp[:busy_coef]
    props = pp[:raw_props]
    list << {
        title: prop.title,
        busy_coef: busy_coef,
        props: props
    }
    # Rails.logger.debug "<render_table_prop_busy_coef> #{prop.title}"
  end

  render :partial => 'c80_estate/shared/table_properties_coef_busy',
         :locals => {
             list: list
         }
end

#render_table_prop_busy_coef_sq(atype_id: nil) ⇒ Object



29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# File 'app/helpers/c80_estate/app_helper.rb', line 29

def render_table_prop_busy_coef_sq(atype_id: nil)
  Rails.logger.debug "<render_table_prop_busy_coef_sq> atype_id = #{atype_id}"

  props = Property.all
  list = []

  props.all.each do |prop|
    pp = Pstat.busy_coef(prop_id: prop.id, atype_id: atype_id)
    # Rails.logger.debug "<render_table_prop_busy_coef> pp = #{pp}"
    busy_coef_sq = pp[:busy_coef_sq]
    props = pp[:raw_props_sq]
    list << {
        title: prop.title,
        busy_coef: busy_coef_sq,
        props: props
    }
    # Rails.logger.debug "<render_table_prop_busy_coef> #{prop.title}"
  end

  render :partial => 'c80_estate/shared/table_properties_coef_busy_sq',
         :locals => {
             list: list
         }
end