Sha256: 7d6611e10af0030413eaa7aaf10d5466b3548cace74babf9a46ea716dc61fdd1
Contents?: true
Size: 549 Bytes
Versions: 16
Compression:
Stored size: 549 Bytes
Contents
class NewsItem < ActiveRecord::Base validates_presence_of :title, :content has_friendly_id :title, :use_slug => true, :strip_diacritics => true acts_as_indexed :fields => [:title, :body] def self.latest(amount = 10) find(:all, :order => "publish_date DESC", :limit => amount, :conditions => ["publish_date < ?", Time.now]) end def not_published? # has the published date not yet arrived? publish_date > Time.now end def content self.body end def content=(value) self.body = value end end
Version data entries
16 entries across 16 versions & 1 rubygems