Ruby rails如何搜索/查找特定时间?

时间:2016-05-13 11:11:53

标签: ruby-on-rails ruby-on-rails-3 ruby-on-rails-4 ruby-on-rails-3.2

您好我正在进行高级搜索,我想使用to_i将requested_time与searchtime进行比较。 我有什么方法可以将requested_time转换为requested_time.to_i吗?怎么样?

search.rb

class Search < ActiveRecord::Base

def search_reservations
    reservations = Reservation.all

    reservations = reservations.where(reservation_time: searchtime) if searchtime.present?
    reservations
end
end

0 个答案:

没有答案