Sha256: a8bc10ff0fb008dc637c2a9ca1681a874700729c9d4ef97c6c9e55368fde6e23

Contents?: true

Size: 364 Bytes

Versions: 2

Compression:

Stored size: 364 Bytes

Contents

class Post < ActiveRecord::Base
  belongs_to :author
  attr_accessible :body, :draft, :published_at, :slug, :story_link, :title
    
  scope :published, lambda { where( [ "draft = ? AND published_at < ?", false, Time.now ] ).order( 'published_at DESC' ) }
  
  scope :draft, where( :draft => true )
  
  extend ::FriendlyId
  friendly_id :title, use: :slugged
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
engrave-1.0.0 app/models/post.rb
engrave-0.0.5 app/models/post.rb