orbit4-5/app/models/group_post.rb

16 lines
494 B
Ruby

class GroupPost
include Mongoid::Document
include Mongoid::Timestamps
include Slug
field :title, as: :slug_title, type: String
field :content
field :read_by, type: Array, default: []
field :author, type: BSON::ObjectId
belongs_to :group
has_many :group_post_images, :autosave => true, :dependent => :destroy
has_many :group_post_files, :autosave => true, :dependent => :destroy
has_many :group_post_comments, :autosave => true, :dependent => :destroy
end