Module: C80Yax::Mixins::Strsubcat::Database::Props

Included in:
Strsubcat
Defined in:
app/models/c80_yax/mixins/strsubcat/database/props.rb

Instance Method Summary collapse

Instance Method Details

#common_props_collectionObject

выдать collection of ‘common props` associated with this Strsubcat



22
23
24
25
26
# File 'app/models/c80_yax/mixins/strsubcat/database/props.rb', line 22

def common_props_collection
  C80Yax::PropName
      .includes(:strsubcats)
      .where(:c80_yax_strsubcats => {:id => self.id})
end

#main_props_collectionObject

выдать collection of ‘main props`, связанных с этой подкатегорией



7
8
9
10
11
# File 'app/models/c80_yax/mixins/strsubcat/database/props.rb', line 7

def main_props_collection
  C80Yax::PropName
      .includes(:strsubcats)
      .where(:c80_yax_strsubcats => {:id => self.id})
end

#prefix_props_collectionObject



28
29
30
31
32
# File 'app/models/c80_yax/mixins/strsubcat/database/props.rb', line 28

def prefix_props_collection
  C80Yax::PropName
      .includes(:strsubcats)
      .where(:c80_yax_strsubcats => {:id => self.id})
end

#price_props_collectionObject

выдать collection of ‘price props` associated with this Strsubcat



14
15
16
17
18
19
# File 'app/models/c80_yax/mixins/strsubcat/database/props.rb', line 14

def price_props_collection
  C80Yax::PropName
      .includes(:strsubcats)
      .where(:c80_yax_strsubcats => {:id => self.id})
      .where(:c80_yax_prop_names => {:is_normal_price => 1})
end