Permalink
Browse files

Fix allocating a Time subclass in Time#at when passed a Time object

Fixes #1113
  • Loading branch information...
dbussink committed Aug 11, 2011
1 parent 724bf3d commit ccda7db7afa293d4f3cf0b18616f7172a55649c5
Showing with 3 additions and 1 deletion.
  1. +3 −1 kernel/common/time.rb
View
@@ -8,7 +8,9 @@ class Time
}
def self.at(sec, usec=nil)
- return sec.dup if sec.kind_of? Time
+ if sec.kind_of? Time
+ return specific(sec.to_i, sec.usec, sec.gmt?)
+ end
if sec.kind_of?(Integer) || usec
sec = Rubinius::Type.coerce_to sec, Integer, :to_i

0 comments on commit ccda7db

Please sign in to comment.