foreman/app/models/taxable_taxonomy.rb @ 783fb4aa
611f5bff | Amos Benari | class TaxableTaxonomy < ActiveRecord::Base
|
|
belongs_to :taxonomy
|
|||
belongs_to :taxable, :polymorphic => true
|
|||
f2c78d4a | Joseph Magen | validates :taxonomy_id, :uniqueness => {:scope => [:taxable_id, :taxable_type]}
|
|
2fa95807 | Joseph Mitchell Magen | ||
scope :without, lambda{ |types|
|
|||
if types.empty?
|
|||
{}
|
|||
else
|
|||
where(["taxable_taxonomies.taxable_type NOT IN (?)",types])
|
|||
end
|
|||
}
|
|||
611f5bff | Amos Benari | end
|