我有一个数组@user.photos,它将返回如下内容:
[#<Photo id: 53, photo_file_name: "Freedom-Tower",
photo_content_type: "image/jpeg", photo_file_size: 1937702,
photo_updated_at: "2013-04-23 23:57:22", user_id: 1,
created_at: "2013-04-23 23:57:23", updated_at: "2013-04-23 23:57:23">,
#<Photo id: 52, photo_file_name: "sunset-Courtsey",
photo_content_type: "image/jpeg", photo_file_size: 1937702,
photo_updated_at: "2013-04-23 23:51:22", user_id: 1,
created_at: "2013-04-23 23:51:24", updated_at: "2013-04-23 23:51:24">
我想创建一个条件来检查用户是否最近创建了一张照片
像:@user.photos.any?{ |x| x.created_at btw Time.now..-5 秒}??