Project

General

Profile

Download (348 Bytes) Statistics
| Branch: | Tag: | Revision:
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