Sha256: 1240e6249ac9e9a0e78a036381470592835436f88526e8719ff952dfb7017bda
Contents?: true
Size: 515 Bytes
Versions: 6
Compression:
Stored size: 515 Bytes
Contents
module Fuel class Post < ActiveRecord::Base extend FriendlyId friendly_id :title, use: :slugged if Rails.version[0].to_i < 4 attr_accessible :tag, :author, :content, :title end validates_presence_of :title, :content, :author, if: :is_published paginates_per 5 def should_generate_new_friendly_id? new_record? #Don't generate new id on edit end def save_as_draft self.published = false end def is_published self.published end end end
Version data entries
6 entries across 6 versions & 1 rubygems