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