You have a syntax error with the ")". It should be like this:
(pickup_time - q[:created_at]) / 1.hour