Sha256: 58c2e43a64136b13d9a0eabc996cb75d7c75508f27d3cf516f837379ce93911a
Contents?: true
Size: 488 Bytes
Versions: 10
Compression:
Stored size: 488 Bytes
Contents
module Jabe class Entry < ActiveRecord::Base before_save :set_published_at has_many :comments extend FriendlyId friendly_id :title, :use => :slugged acts_as_textiled :body default_scope :order => 'published_at DESC' scope :drafts, :conditions => { :draft => true } scope :published, :conditions => { :draft => false } private def set_published_at self.published_at = Time.now unless draft? || self.published_at end end end
Version data entries
10 entries across 10 versions & 1 rubygems