Sha256: 38cf08036c62f25cc5acb08fd89d8d8d4e36707cc68db3a07f8600e97a736ce1

Contents?: true

Size: 266 Bytes

Versions: 2

Compression:

Stored size: 266 Bytes

Contents

class Post < ActiveRecord::Base
  belongs_to :category
  has_many :comments
  belongs_to :writer


  scope :preload_posts, lambda { includes(:comments) }
  scope :in_category_name, lambda { |name|
    where(['categories.name = ?', name]).includes(:category)
  }
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
bullet-2.3.1 spec/models/post.rb
bullet-2.3.0 spec/models/post.rb