announcement-test/app/models/bulletin_feed.rb

11 lines
273 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: []
before_save do
BulletinFeedCache.where(uid: self.uid).destroy
end
end