ruby 1.9.3p0 (2011-10-30 revision 33570) [x86_64-linux]
$ irb
1.9.3p0 :001 > require 'rubygems'
=> false
1.9.3p0 :002 > require 'active_support/core_ext/date/calculations.rb'
=> true
1.9.3p0 :003 > require 'active_support/core_ext/integer/time.rb'
=> true
1.9.3p0 :004 > require 'active_support/core_ext/numeric/time.rb'
=> true
1.9.3p0 :005 > 0.months.since Date.current
ArgumentError: expected a time or date, got #<Date: 2012-08-05
((2456145j,0s,0n),+0s,2299161j)>
from
/home/d/.rvm/gems/ruby-1.9.3-p0\@t/gems/activesupport-3.2.7/lib/active_support/basic_object.rb:11:in
`raise'
from
/home/d/.rvm/gems/ruby-1.9.3-p0\@t/gems/activesupport-3.2.7/lib/active_support/duration.rb:99:in
`block in sum'
from
/home/d/.rvm/gems/ruby-1.9.3-p0\@t/gems/activesupport-3.2.7/lib/active_support/duration.rb:91:in
`each'
from
/home/d/.rvm/gems/ruby-1.9.3-p0\@t/gems/activesupport-3.2.7/lib/active_support/duration.rb:91:in
`inject'
from
/home/d/.rvm/gems/ruby-1.9.3-p0\@t/gems/activesupport-3.2.7/lib/active_support/duration.rb:91:in
`sum'
from
/home/d/.rvm/gems/ruby-1.9.3-p0\@t/gems/activesupport-3.2.7/lib/active_support/duration.rb:63:in
`since'
from (irb):5
from /home/d/.rvm/rubies/ruby-1.9.3-p0/bin/irb:16:in `<main>'
With 1.8.7:
ArgumentError: expected a time or date, got #<Date: 4912289/2,0,2299161>
from
/var/lib/gems/1.8/gems/activesupport-3.2.7/lib/active_support/duration.rb:99:in
`sum'
from (irb):6:in `inject'
from
/var/lib/gems/1.8/gems/activesupport-3.2.7/lib/active_support/duration.rb:91:in
`each'
from
/var/lib/gems/1.8/gems/activesupport-3.2.7/lib/active_support/duration.rb:91:in
`inject'
from
/var/lib/gems/1.8/gems/activesupport-3.2.7/lib/active_support/duration.rb:91:in
`sum'
from
/var/lib/gems/1.8/gems/activesupport-3.2.7/lib/active_support/duration.rb:63:in
`since'
from (irb):6
from :0
thank you in advance
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/Cnaj1XYeXZAJ.
For more options, visit https://groups.google.com/groups/opt_out.