diff options
Diffstat (limited to 'activesupport/lib')
-rw-r--r-- | activesupport/lib/active_support/time_with_zone.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/activesupport/lib/active_support/time_with_zone.rb b/activesupport/lib/active_support/time_with_zone.rb index 461d52e40e..21ddcaad48 100644 --- a/activesupport/lib/active_support/time_with_zone.rb +++ b/activesupport/lib/active_support/time_with_zone.rb @@ -163,6 +163,14 @@ module ActiveSupport utc.advance(options).in_time_zone(time_zone) end + %w(year mon month day mday hour min sec).each do |method_name| + class_eval <<-EOV + def #{method_name} + time.#{method_name} + end + EOV + end + def usec time.respond_to?(:usec) ? time.usec : 0 end |