Skip to content

Commit

Permalink
Merge pull request #16445 from martinpovolny/catalog_unassigned
Browse files Browse the repository at this point in the history
ServiceTemplate: add scope for unassigned items.
(cherry picked from commit 46f5a53)

https://bugzilla.redhat.com/show_bug.cgi?id=1513141
  • Loading branch information
kbrock authored and simaishi committed Nov 14, 2017
1 parent c6a82d3 commit 3b602e1
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions app/models/service_template.rb
Original file line number Diff line number Diff line change
@@ -65,6 +65,7 @@ class ServiceTemplate < ApplicationRecord
virtual_has_one :config_info, :class_name => "Hash"

scope :with_service_template_catalog_id, ->(cat_id) { where(:service_template_catalog_id => cat_id) }
scope :without_service_template_catalog_id, -> { where(:service_template_catalog_id => nil) }
scope :with_existent_service_template_catalog_id, -> { where.not(:service_template_catalog_id => nil) }
scope :displayed, -> { where(:display => true) }

0 comments on commit 3b602e1

Please sign in to comment.