美文网首页
Rails: Where Statement

Rails: Where Statement

作者: bookinstock_ | 来源:发表于2017-04-27 21:43 被阅读10次

time

  • where(completed_at: 1.week.ago .. Time.current)
  • where('timesheets.updated_at < ?', 1.week.ago)
  • where('timesheets.submitted_at <= ?', 2.days.ago)
  • where('timesheets.applied_at >= ?', 1.month.from_now)

sql

  • check query statement with #to_sql method.

相关文章

网友评论

      本文标题:Rails: Where Statement

      本文链接:https://www.haomeiwen.com/subject/ijinzttx.html