Raecoo 的窝
分类
未分类
j
Raecoo
最新评论
最新留言
友情链接
haha
2008年5月26日 23:16
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
Posted by Raecoo
Filed in
未分类
Tagged by
Comments[0]