How do I use ActiveSupport core extensions?

When I try to use 1.week.ago I get

NoMethodError: undefined method 'week' for 1:Fixnum from (irb):2

 

Read How to Load Core Extensions .

 

You can :
require 'active_support/core_ext'
or :
require 'active_support/all'

 

 

你可能感兴趣的:(Active)