RoR中的ActiveRecord如何选择日期小于的数据

时间:2013-04-04 10:00:12

标签: ruby-on-rails activerecord

请解决这个问题:

@d_repeats = Event.where(:repeat => 'daily', :shedule < date.end_of_month )

此处:shedule < date.end_of_month不正确。怎么样?

1 个答案:

答案 0 :(得分:10)

你可以做到

@d_repeats = Event.where(:repeat => 'daily').where("schedule < ?", date.end_of_month )