class Post < ActiveRecord::Base
  # Find no more than 10 posts published within the last 7 days.
  def self.find_recent
    cutoff_date = 7.days.ago.to_formatted_s(:db)
    options = {
      :conditions => [ "published_at >= ?", cutoff_date ], 
      :limit => 10
    }
    find(:all, options)
  end
end