Skip to content

Instantly share code, notes, and snippets.

@paul
Created Apr 18, 2011
Embed
What would you like to do?
$ irb
>> require 'active_support/core_ext/numeric/time'
=> true
>> 1.hour.ago
NoMethodError: undefined method `current' for Time:Class
from /Users/rando/.rvm/gems/ree-1.8.7-2011.03@core/gems/activesupport-3.0.5/lib/active_support/duration.rb:68:in `ago'
from (irb):2
>> require 'active_support/core_ext/time/calculations'
=> true
>> 1.hour.ago
ArgumentError: expected a time or date, got Mon Apr 18 17:23:07 -0600 2011
from /Users/rando/.rvm/gems/ree-1.8.7-2011.03@core/gems/activesupport-3.0.5/lib/active_support/duration.rb:94:in `sum'
from (irb):4:in `inject'
from /Users/rando/.rvm/gems/ree-1.8.7-2011.03@core/gems/activesupport-3.0.5/lib/active_support/duration.rb:86:in `each'
from /Users/rando/.rvm/gems/ree-1.8.7-2011.03@core/gems/activesupport-3.0.5/lib/active_support/duration.rb:86:in `inject'
from /Users/rando/.rvm/gems/ree-1.8.7-2011.03@core/gems/activesupport-3.0.5/lib/active_support/duration.rb:86:in `sum'
from /Users/rando/.rvm/gems/ree-1.8.7-2011.03@core/gems/activesupport-3.0.5/lib/active_support/duration.rb:69:in `ago'
from (irb):4
>> require 'active_support/core_ext/time/acts_like'
=> true
>> 1.hour.ago
=> Mon Apr 18 16:23:12 -0600 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment