This repository has been archived on 2024-03-16. You can view files and clone it, but cannot push or open issues or pull requests.
orbit-4-1/app/models/buffer_category.rb

16 lines
314 B
Ruby
Raw Permalink 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