haha
Raecoo
posted @ 2008年5月26日 23:16
in 未分类
, 1123 阅读
class Topic < ActiveRecord::Base def self.find_latest(time = nil) r = %w( hour day week month year ) if r.include?(time) self.find :all, :conditions => ['created_at > ?', 1.send(time).ago] else self.find :all end end end