aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/time_with_zone.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activesupport/lib/active_support/time_with_zone.rb')
-rw-r--r--activesupport/lib/active_support/time_with_zone.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/activesupport/lib/active_support/time_with_zone.rb b/activesupport/lib/active_support/time_with_zone.rb
index 9d1147620c..f91225289d 100644
--- a/activesupport/lib/active_support/time_with_zone.rb
+++ b/activesupport/lib/active_support/time_with_zone.rb
@@ -84,6 +84,12 @@ module ActiveSupport
end
alias_method :getlocal, :localtime
+ def to_time_with_caching
+ @to_time ||= to_time_without_caching
+ end
+ alias_method :to_time_without_caching, :to_time
+ alias_method :to_time, :to_time_with_caching
+
# Returns true if the current time is within Daylight Savings Time for the
# specified time zone.
#