Module: Content::HostgroupExtensions
- Extended by:
- ActiveSupport::Concern
- Defined in:
- app/models/concerns/content/hostgroup_extensions.rb
Instance Method Summary collapse
- #all_content_views_ids ⇒ Object
- #all_product_ids ⇒ Object
- #inherited_content_view_ids ⇒ Object
- #inherited_product_ids ⇒ Object
Instance Method Details
#all_content_views_ids ⇒ Object
29 30 31 |
# File 'app/models/concerns/content/hostgroup_extensions.rb', line 29 def all_content_views_ids (inherited_content_view_ids + content_view_ids).uniq end |
#all_product_ids ⇒ Object
20 21 22 |
# File 'app/models/concerns/content/hostgroup_extensions.rb', line 20 def all_product_ids (inherited_product_ids + product_ids).uniq end |
#inherited_content_view_ids ⇒ Object
24 25 26 27 |
# File 'app/models/concerns/content/hostgroup_extensions.rb', line 24 def inherited_content_view_ids return [] if hostgroup.ancestor_ids.empty? Content::ContentView.where(:originator_id => hostgroup.ancestor_ids, :originator_type => 'Hostgroup').pluck(:id) end |
#inherited_product_ids ⇒ Object
15 16 17 18 |
# File 'app/models/concerns/content/hostgroup_extensions.rb', line 15 def inherited_product_ids return [] if hostgroup.ancestor_ids.empty? Content::HostgroupProduct.where(:hostgroup_id => hostgroup.ancestor_ids).pluck(:product_id) end |