File: post.rb

package info (click to toggle)
ruby-bullet 7.2.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 836 kB
  • sloc: ruby: 6,133; javascript: 57; sh: 27; makefile: 4
file content (14 lines) | stat: -rw-r--r-- 314 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
# frozen_string_literal: true

class Mongoid::Post
  include Mongoid::Document

  field :name

  has_many :comments, class_name: 'Mongoid::Comment'
  belongs_to :category, class_name: 'Mongoid::Category'

  embeds_many :users, class_name: 'Mongoid::User'

  scope :preload_comments, -> { includes(:comments) }
end