public
Fork of rails/rails
Description: Ruby on Rails
Homepage: http://rubyonrails.org
Clone URL: git://github.com/jdelStrother/rails.git
InstanceTag#default_time_from_options overflows to DateTime
gbuesing (author)
Sun May 18 08:59:24 -0700 2008
commit  e30a263bf1744d0b55d073c7d1087d0d64181d2c
tree    5deb91e3c055264400c29b07740cc33f44269b98
parent  be85868987675a158fd4111393b9161296431728
...
 
 
1
2
3
...
1
2
3
4
5
0
@@ -1,3 +1,5 @@
0
+* InstanceTag#default_time_from_options overflows to DateTime [Geoff Buesing]
0
+
0
 *2.1.0 RC1 (May 11th, 2008)*
0
 
0
 * Fixed that forgery protection can be used without session tracking (Peter Jones) [#139]
...
689
690
691
692
 
693
694
695
...
689
690
691
 
692
693
694
695
0
@@ -689,7 +689,7 @@ module ActionView
0
                 default[key] ||= time.send(key)
0
               end
0
 
0
- Time.utc(default[:year], default[:month], default[:day], default[:hour], default[:min], default[:sec])
0
+ Time.utc_time(default[:year], default[:month], default[:day], default[:hour], default[:min], default[:sec])
0
             end
0
         end
0
     end
...
1722
1723
1724
 
 
 
 
 
 
1725
1726
1727
...
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
0
@@ -1722,6 +1722,12 @@ class DateHelperTest < ActionView::TestCase
0
         assert_equal 2, dummy_instance_tag.send!(:default_time_from_options, :hour => 2).hour
0
       end
0
     end
0
+
0
+ def test_instance_tag_default_time_from_options_handles_far_future_date
0
+ dummy_instance_tag = ActionView::Helpers::InstanceTag.new(1,2,3)
0
+ time = dummy_instance_tag.send!(:default_time_from_options, :year => 2050, :month => 2, :day => 10, :hour => 15, :min => 30, :sec => 45)
0
+ assert_equal 2050, time.year
0
+ end
0
   end
0
   
0
   protected

Comments

    No one has commented yet.