Sha256: 200d8f15771160917a5a6728e46cb3c43cb5a4b4c232e03ba3fa86d82182e441
Contents?: true
Size: 1.26 KB
Versions: 9
Compression:
Stored size: 1.26 KB
Contents
# # Copyright (c) 2014 Red Hat Inc. # # This software is licensed to you under the GNU General Public License, # version 3 (GPLv3). There is NO WARRANTY for this software, express or # implied, including the implied warranties of MERCHANTABILITY or FITNESS # FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv3 # along with this software; if not, see http://www.gnu.org/licenses/gpl.txt # require 'scaptimony/scap_content' module ForemanOpenscap module ScapContentExtensions extend ActiveSupport::Concern include Authorizable include Taxonomix included do attr_accessible :location_ids, :organization_ids default_scope { with_taxonomy_scope do order("scaptimony_scap_contents.title") end } end def used_location_ids Location.joins(:taxable_taxonomies).where( 'taxable_taxonomies.taxable_type' => 'Scaptimony::ScapContent', 'taxable_taxonomies.taxable_id' => id).pluck("#{Location.arel_table.name}.id") end def used_organization_ids Organization.joins(:taxable_taxonomies).where( 'taxable_taxonomies.taxable_type' => 'Scaptimony::ScapContent', 'taxable_taxonomies.taxable_id' => id).pluck("#{Location.arel_table.name}.id") end end end
Version data entries
9 entries across 9 versions & 1 rubygems