Sha256: 697d2d98a1b178813a1985ec25898b07c538a0347e0c1925c833849b8a8121ae

Contents?: true

Size: 301 Bytes

Versions: 12

Compression:

Stored size: 301 Bytes

Contents

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

  belongs_to :category
  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

12 entries across 12 versions & 2 rubygems

Version Path
bullet_instructure-4.0.5 spec/models/post.rb
bullet_instructure-4.0.3 spec/models/post.rb
bullet_instructure-4.0.2 spec/models/post.rb
bullet-4.11.3 spec/models/post.rb
bullet-4.11.2 spec/models/post.rb
bullet-4.11.1 spec/models/post.rb
bullet-4.11.0 spec/models/post.rb
bullet-4.10.0 spec/models/post.rb
bullet-4.9.0 spec/models/post.rb
bullet-4.8.0 spec/models/post.rb
bullet-4.7.1 spec/models/post.rb
bullet-4.7.0 spec/models/post.rb