Mysql 如何在Rails查询中使用STR_to_DATE函数?

Mysql 如何在Rails查询中使用STR_to_DATE函数?,mysql,ruby-on-rails,Mysql,Ruby On Rails,RubyonRails4+Mysql 这是mysql中一个运行良好的查询 select * from `schedules` WHERE (STR_TO_DATE(departure_time,'%h:%i%p') >= TIME(NOW()) and travel_date ='2014-06-09' and origin_id ='134' and destination_id ='251' and operator_id not in (SELECT id FROM `operat

RubyonRails4+Mysql

这是mysql中一个运行良好的查询

select * from `schedules` 
WHERE (STR_TO_DATE(departure_time,'%h:%i%p') >= TIME(NOW()) and travel_date ='2014-06-09' and origin_id ='134' and destination_id ='251' and operator_id not in (SELECT id FROM `operators` WHERE (status != 'Active')) and status ='Active' and available_seats > 0)
ORDER BY STR_TO_DATE(departure_time,'%h:%i%p'); 
我想在Rails中编写这个查询。如何给这一个“按stru到日期(出发时间,%h:%i%p)”的订单;在rails 4中,任何建议/提示…

什么是截止日期?