Sha256: 8c0300c0bae9591b951edb9c34faea6e8e15c75b07a9e2b0f90ad32b675a1d16

Contents?: true

Size: 321 Bytes

Versions: 5

Compression:

Stored size: 321 Bytes

Contents

class Post < ActiveRecord::Base
  extend Bullet::Dependency

  belongs_to :category, inverse_of: :posts
  belongs_to :writer
  has_many :comments, inverse_of: :post

  scope :preload_comments, -> { includes(:comments) }
  scope :in_category_name, ->(name) { where(['categories.name = ?', name]).includes(:category) }
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
bullet-4.14.0 spec/models/post.rb
bullet-4.13.2 spec/models/post.rb
bullet-4.13.1 spec/models/post.rb
bullet-4.13.0 spec/models/post.rb
bullet-4.12.0 spec/models/post.rb