forked from saurabh/orbit4-5
16 lines
494 B
Ruby
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 |