Sha256: 8c390aa851aa5474a1001a91beb8e5eaf76d83f61d567c3560f7e4ae92bd84b2
Contents?: true
Size: 428 Bytes
Versions: 10
Compression:
Stored size: 428 Bytes
Contents
class Entry < ActiveRecord::Base before_save :set_published_at has_many :comments has_friendly_id :title, :use_slug => true 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
Version data entries
10 entries across 10 versions & 1 rubygems