orbit4-5/app/models/group_post.rb

16 lines
494 B
Ruby
Raw Normal View History

2015-03-25 07:46:11 +00:00
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
2015-04-14 07:18:58 +00:00
has_many :group_post_files, :autosave => true, :dependent => :destroy
has_many :group_post_comments, :autosave => true, :dependent => :destroy
2015-03-25 07:46:11 +00:00
end