Reputation: 1276
I am fairly new to rails, and attempting to add an amount of time to a datetime in the database. The time and time unit both are returned from the database.
So the data is...
start: 11/1/2015 10:45:00
duration: 75
unit: "minutes"
I want to add the 75 minutes to the start. I know I can do this if I know them already by saying start + 75.minutes, but how do I do this when both the duration and the unit are variables?
Upvotes: 1
Views: 41