Sha256: 68dfd2e454b017ad8b230f70f2862415c085ebc281e73ebd19826cdc8d7a4661

Contents?: true

Size: 436 Bytes

Versions: 4

Compression:

Stored size: 436 Bytes

Contents

class Post < ActiveRecord::Base
  extend Enumerize
  extend FriendlyId

  attr_accessible :content, :date, :slug, :source, :status, :title, :type, :image, :image_cache
  friendly_id :title, use: :slugged
  enumerize :status, in: [:published, :unpublished], default: :published, predicates: true


  validates_presence_of :title, :date


  scope :published, where(status: :published)

  mount_uploader :image, Writer::ImageUploader

end

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
mix-rails-0.23.1 mix-rails-writer/app/models/post.rb
mix-rails-writer-0.23.1 app/models/post.rb
mix-rails-0.23.0 mix-rails-writer/app/models/post.rb
mix-rails-writer-0.23.0 app/models/post.rb