Duck typing here

This commit is contained in:
Santiago Pastorino 2010-11-11 01:33:27 -02:00
parent 5dc7f34dca
commit 2651a87a33
1 changed files with 1 additions and 1 deletions

View File

@ -73,7 +73,7 @@ module ActiveSupport
# Returns a <tt>Time.local()</tt> instance of the simultaneous time in your system's <tt>ENV['TZ']</tt> zone
def localtime
utc.is_a?(DateTime) ? utc.to_time.getlocal : utc.getlocal
utc.respond_to?(:getlocal) ? utc.getlocal : utc.to_time.getlocal
end
alias_method :getlocal, :localtime