您好我正在进行高级搜索,我想使用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