[Rails] Re: [Feature idea] Truncating timestamp precision

2014-10-06 Thread Robert Walker
Agis A. wrote in post #1159152: > Of course I can. I wanted to know if this seems useful to other people > using Rails so I can start to work on this feature. This doesn't feel to me like the sort of feature that warrants inclusion in ActiveSupport. There are a multitude of possible functions sim

[Rails] Re: [Feature idea] Truncating timestamp precision

2014-10-06 Thread powi
Of course I can. I wanted to know if this seems useful to other people using Rails so I can start to work on this feature. On Monday, 6 October 2014 16:45:21 UTC+3, jsnark wrote: > > You can extend the class yourself: > > DateTime.class_eval do > define_method(:truncate_precision) { |amount| >

[Rails] Re: [Feature idea] Truncating timestamp precision

2014-10-06 Thread jsnark
You can extend the class yourself: DateTime.class_eval do define_method(:truncate_precision) { |amount| puts amount } end => # DateTime.now.truncate_precision(sec: 10) {:sec=>10} => nil On Monday, October 6, 2014 8:17:58 AM UTC-4, powi wrote: > > Hello. > > I thought of adding a method i