Sha256: cb9366d43447fd4c10d4322f6f5fa1eac0a3f5f4659545b43add744af5b04123

Contents?: true

Size: 350 Bytes

Versions: 3

Compression:

Stored size: 350 Bytes

Contents

class Post < ActiveRecord::Base
  belongs_to :author
  attr_accessible :body, :draft, :published_at, :slug, :story_link, :title
    
  scope :published, 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

3 entries across 3 versions & 1 rubygems

Version Path
engrave-0.0.4 app/models/post.rb
engrave-0.0.3 app/models/post.rb
engrave-0.0.2 app/models/post.rb