class Iteration < ActiveRecord::Base hobo_model set_field_type :body=>:textile validates_presence_of :title validates_uniqueness_of :title has_many :comments set_default_order "created_at DESC" def display_name "#{self.title} (#{self.created_at.to_formatted_s(:datum_kurz)})" end def feed_description self.body.to_html end def author "Niko Dittmann" end def feed_id "NikoDittmann::Plog_Iteration_#{self.id}_#{self.created_at.xmlschema}" end def self.find_latest Iteration.find(:all, :limit=>5, :order=>"created_at DESC") end def self.last_updated_at Iteration.find(:first, :select=>:updated_at, :order=>"updated_at DESC").updated_at end # --- Hobo Permissions --- # def creatable_by?(creator) false end def updatable_by?(updater, new) false end def deletable_by?(deleter) false end def viewable_by?(viewer, field) true end end