aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib
diff options
context:
space:
mode:
authorAlvaro Bautista <alvarobp@gmail.com>2010-09-11 21:12:10 +0200
committerSantiago Pastorino <santiago@wyeworks.com>2010-11-11 01:30:28 -0200
commit5dc7f34dca3a5b0bd65dff157ae547347e86670e (patch)
tree3a989588eaaff826172aa22cb68ed8f4e2f1c902 /activesupport/lib
parentc577e90f61b060164589e7112838e461c42bfe29 (diff)
downloadrails-5dc7f34dca3a5b0bd65dff157ae547347e86670e.tar.gz
rails-5dc7f34dca3a5b0bd65dff157ae547347e86670e.tar.bz2
rails-5dc7f34dca3a5b0bd65dff157ae547347e86670e.zip
Fix ActiveSupport::TimeWithZone#localtime method with DateTime
[#5344 state:committed] Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
Diffstat (limited to 'activesupport/lib')
-rw-r--r--activesupport/lib/active_support/time_with_zone.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activesupport/lib/active_support/time_with_zone.rb b/activesupport/lib/active_support/time_with_zone.rb
index 93f5d5a0cc..d993ba3c2a 100644
--- a/activesupport/lib/active_support/time_with_zone.rb
+++ b/activesupport/lib/active_support/time_with_zone.rb
@@ -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.getlocal
+ utc.is_a?(DateTime) ? utc.to_time.getlocal : utc.getlocal
end
alias_method :getlocal, :localtime