原创作者: hideto
阅读:1211次
评论:0条
更新时间:2011-05-26
没什么新意:
>> Task.sum(:priority) => 15 >> Task.sum(:priority, :conditions => 'complete=0') => 13 >> Task.maximum(:priority) => 4 >> Task.minimum(:priority) => 1 >> Task.average(:priority) => 2.5 >> p = Project.find(:first) => #<Project:0x32dce38 @attrbutes={"name" => "Programming", "id" => "1"}> >> p.tasks.sum(:priority) => 9 >> p.tasks.sum(:priority, :conditions => 'complete=0') => 7
评论 共 0 条 请登录后发表评论