Orbit/app/models/buffer_category.rb

16 lines
314 B
Ruby
Raw Normal View History

class BufferCategory
include Mongoid::Document
include Mongoid::Timestamps
belongs_to :category
belongs_to :categorizable, polymorphic: true
before_destroy :remove_categorizable_category_id
private
def remove_categorizable_category_id
self.categorizable.remove_id(self.category.id)
end
end