This project is archived and is in readonly mode.
next_month get stuck
-
eafou6g
I'm sorry, I found that it correctly throws ArgumentError exception on rails 3.0.1
irb(main):004:0> DateTime.new(1125899999995008, 12).next_month ArgumentError: invalid date from /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.1/lib/active_support/core_ext/date/calculations.rb:20:in `>>' from /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.1/lib/active_support/core_ext/date/calculations.rb:110:in `advance' from /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.1/lib/active_support/core_ext/date_time/calculations.rb:53:in `advance' from /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.1/lib/active_support/core_ext/date/calculations.rb:137:in `months_since' from /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.1/lib/active_support/core_ext/date/calculations.rb:167:in `next_month' from (irb):4 -
Elliot Winkler
Which version of Rails were you testing in the first case?
-
eafou6g
rails: 2.3.8
ruby: ruby 1.8.7 (2010-01-10 patchlevel 249) [i486-linux]Is it enough?
-
Andrés Mejía
I can confirm this on Ruby 1.9 and Rails 3.0.1. However, the exception is raised on Ruby's code and not Rails itself:
$ rails c Loading development environment (Rails 3.0.1) ruby-1.9.2-p0 > DateTime.new(1125899999995008, 11).next_month => Sat, 01 Dec 1125899999995008 00:00:00 +0000 ruby-1.9.2-p0 > DateTime.new(1125899999995008, 12).next_month ArgumentError: invalid date from /Users/wack-a-mole/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/date.rb:1421:in `>>' from /Users/wack-a-mole/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/date.rb:1434:in `next_month' from (irb):2 from /Users/wack-a-mole/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.0.1/lib/rails/commands/console.rb:44:in `start' from /Users/wack-a-mole/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.0.1/lib/rails/commands/console.rb:8:in `start' from /Users/wack-a-mole/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.0.1/lib/rails/commands.rb:23:in `<top (required)>' from script/rails:6:in `require' from script/rails:6:in `<main>' -
Santiago Pastorino
- State changed from new to open
This issue has been automatically marked as stale because it has not been commented on for at least three months.
The resources of the Rails core team are limited, and so we are asking for your help. If you can still reproduce this error on the 3-0-stable branch or on master, please reply with all of the information you have about it and add "[state:open]" to your comment. This will reopen the ticket for review. Likewise, if you feel that this is a very important feature for Rails to include, please reply with your explanation so we can consider it.
Thank you for all your contributions, and we hope you will understand this step to focus our efforts where they are most helpful.
-
Santiago Pastorino
- State changed from open to stale
-
eafou6g
It is not Rails' bug, but Ruby's.
And it seems for me that it was fixed at ruby-1.8.7-p299.
Anyway, please ignore this ticket.
Thank you.$ ./script/console Loading development environment (Rails 2.3.8) ruby-1.8.7-p249 :001 > DateTime.new(1125899999995008, 12).next_month ^CIRB::Abort: abort then interrupt!! ...$ ./script/console Loading development environment (Rails 2.3.8) ruby-1.8.7-p299 :001 > DateTime.new(1125899999995008, 12).next_month ArgumentError: invalid date ...