announcement-test/app/models/bulletin_feed.rb

12 lines
320 B
Ruby

class BulletinFeed
include Mongoid::Document
include Mongoid::Timestamps
include Slug
field :title, as: :slug_title, type: String, localize: true
field :tag_ids, type: Array, default: []
field :category_ids, type: Array, default: []
before_save do
BulletinFeedCache.where(uid: self.uid).destroy
end
end