class Post < ActiveRecord::Base
  # Znajd nie wicej ni 10 postw napisanych w cigu ostatnich siedmiu dni.
  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