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

Version Path
jabe-0.5.9 app/models/entry.rb
jabe-0.5.8 app/models/entry.rb
jabe-0.5.7 app/models/entry.rb
jabe-0.5.6 app/models/entry.rb
jabe-0.5.5 app/models/entry.rb
jabe-0.5.4 app/models/entry.rb
jabe-0.5.3 app/models/entry.rb
jabe-0.5.2 app/models/entry.rb
jabe-0.5.1 app/models/entry.rb
jabe-0.5.0 app/models/entry.rb