Ruby on Rails 4 + 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中。如何给这一个`ORDER BY STR_TO_DATE(departure_time,'%h:%i%p')';在rails 4任何建议/提示......