Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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

Fixes #1113
  • Loading branch information...
commit ccda7db7afa293d4f3cf0b18616f7172a55649c5 1 parent 724bf3d
@dbussink dbussink authored
Showing with 3 additions and 1 deletion.
  1. +3 −1 kernel/common/time.rb
View
4 kernel/common/time.rb
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.