aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib
diff options
context:
space:
mode:
authorstopdropandrew <andrew@kongregate.com>2013-02-24 13:07:20 -0800
committerstopdropandrew <andrew@kongregate.com>2013-02-24 13:24:50 -0800
commitcb100ca02bf0652e39a61e7687a6ac034b1a9c43 (patch)
treef06d115b43d7cd28e6e8c3c35d1dc298a71fc9c9 /activesupport/lib
parent1509844cdd53e137f8ae02d2df52d811357426ec (diff)
downloadrails-cb100ca02bf0652e39a61e7687a6ac034b1a9c43.tar.gz
rails-cb100ca02bf0652e39a61e7687a6ac034b1a9c43.tar.bz2
rails-cb100ca02bf0652e39a61e7687a6ac034b1a9c43.zip
Added `ActiveSupport::TimeWithZone#to_r` for `Time#at` compatibility.
Diffstat (limited to 'activesupport/lib')
-rw-r--r--activesupport/lib/active_support/time_with_zone.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/activesupport/lib/active_support/time_with_zone.rb b/activesupport/lib/active_support/time_with_zone.rb
index 0e6d12a186..98c866ac43 100644
--- a/activesupport/lib/active_support/time_with_zone.rb
+++ b/activesupport/lib/active_support/time_with_zone.rb
@@ -317,6 +317,10 @@ module ActiveSupport
end
alias_method :tv_sec, :to_i
+ def to_r
+ utc.to_r
+ end
+
# Return an instance of Time in the system timezone.
def to_time
utc.to_time