aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support
diff options
context:
space:
mode:
authorSantiago Pastorino <santiago@wyeworks.com>2010-11-11 01:33:27 -0200
committerSantiago Pastorino <santiago@wyeworks.com>2010-11-11 01:33:27 -0200
commit2651a87a33981953e2f7966c69dc87e370a7ff11 (patch)
tree156cdd8a9013acb57f45f30223bce68b4491dd22 /activesupport/lib/active_support
parent5dc7f34dca3a5b0bd65dff157ae547347e86670e (diff)
downloadrails-2651a87a33981953e2f7966c69dc87e370a7ff11.tar.gz
rails-2651a87a33981953e2f7966c69dc87e370a7ff11.tar.bz2
rails-2651a87a33981953e2f7966c69dc87e370a7ff11.zip
Duck typing here
Diffstat (limited to 'activesupport/lib/active_support')
-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 d993ba3c2a..6a7da8266c 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.is_a?(DateTime) ? utc.to_time.getlocal : utc.getlocal
+ utc.respond_to?(:getlocal) ? utc.getlocal : utc.to_time.getlocal
end
alias_method :getlocal, :localtime