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.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/activesupport/lib/active_support/time_with_zone.rb b/activesupport/lib/active_support/time_with_zone.rb
index 9a2d283b30..99be89fdf0 100644
--- a/activesupport/lib/active_support/time_with_zone.rb
+++ b/activesupport/lib/active_support/time_with_zone.rb
@@ -199,7 +199,7 @@ module ActiveSupport
# If we're subtracting a Duration of variable length (i.e., years, months, days), move backwards from #time,
# otherwise move backwards #utc, for accuracy when moving across DST boundaries
if other.acts_like?(:time)
- utc - other
+ utc.to_f - other.to_f
elsif duration_of_variable_length?(other)
method_missing(:-, other)
else
@@ -234,9 +234,9 @@ module ActiveSupport
%w(year mon month day mday wday yday hour min sec to_date).each do |method_name|
class_eval <<-EOV
- def #{method_name}
- time.#{method_name}
- end
+ def #{method_name} # def year
+ time.#{method_name} # time.year
+ end # end
EOV
end