2011-11-20 70 views
1

我想在普通的Ruby文件中使用ActiveSupport擴展3600.seconds語法,但我無法找到需要的正確ActiveSupport文件。如何櫻桃選擇active_support 5秒?

據我可以計算from the guides,我需要require "active_support/core_ext/date/calculations"。這似乎不這樣做雖然

NoMethodError: 
    undefined method `seconds' for 3600:Fixnum 

回答

3

在的ActiveSupport與Rails的3.1這個擴展是active_support/core_ext/numeric/time去。你可以看到它here