0

In my Padrino application i'm trying to get the time 10 years from now using

10.year.from_now

I'm getting:

NoMethodError: undefined method `year' for 10:Fixnum

Any idea why ?!

refaelos
  • 7,927
  • 7
  • 36
  • 55

1 Answers1

2

ActiveSupport is not fully loaded by default this because differently than rails Padrino aims to be small and fast.

If you use ActiveRecord a full set of ActiveSupport will be loaded otherwise you need to require (i.e. in boot.rb) your dependencies. In your case:

require 'active_support/core_ext'
require 'active_support/duration'

My suggestion is to load a full active_support set whenever is really needed.

DAddYE
  • 1,719
  • 11
  • 16