Re: [Rails] Retrieve duration (in string format) from database and convert to Ruby syntax for calculation

2013-09-24 Thread Fai Wong
Thanks for your help everyone. I ended up using Chronic Duration gem. https://github.com/hpoydar/chronic_duration On Sunday, September 22, 2013 3:58:58 PM UTC+8, Colin Law wrote: On 20 September 2013 08:30, Fai Wong wong...@gmail.com javascript: wrote: If I store 1.month as a string in

Re: [Rails] Retrieve duration (in string format) from database and convert to Ruby syntax for calculation

2013-09-22 Thread Colin Law
On 20 September 2013 08:30, Fai Wong wongw...@gmail.com wrote: If I store 1.month as a string in the database, how do I convert 1.month into 1.month? This way I can use the 1.month value stored in database to perform the following calculation. Time.now + 1.month If you really feel you need

[Rails] Retrieve duration (in string format) from database and convert to Ruby syntax for calculation

2013-09-20 Thread Fai Wong
If I store 1.month as a string in the database, how do I convert 1.month into 1.month? This way I can use the 1.month value stored in database to perform the following calculation. Time.now + 1.month -- You received this message because you are subscribed to the Google Groups Ruby on