Rubyでは、次のことを試みています。ように時間の量を表す文字列(「1時間」、「1日」、「3日」)であり、「ので」Rubyの文字列を使った日時演算
def self.stats(since)
return Events.find(:all, :select => 'count(*) as this_count', :conditions => ['Date(event_date) >= ?', (Time.now - since)]).first.this_count
end
。助言がありますか?