aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/time_with_zone.rb
diff options
context:
space:
mode:
authorGeoff Buesing <gbuesing@gmail.com>2008-03-17 05:50:13 +0000
committerGeoff Buesing <gbuesing@gmail.com>2008-03-17 05:50:13 +0000
commit54ccdd334385fea706eb8d5b3ed95d7102a9d0d4 (patch)
tree6e2a492c31911cefad337f732132fd41285bda5b /activesupport/lib/active_support/time_with_zone.rb
parentfe7c68ee5d4d78b705bc91c0652b05202b3eb30e (diff)
downloadrails-54ccdd334385fea706eb8d5b3ed95d7102a9d0d4.tar.gz
rails-54ccdd334385fea706eb8d5b3ed95d7102a9d0d4.tar.bz2
rails-54ccdd334385fea706eb8d5b3ed95d7102a9d0d4.zip
Time, DateTime and TimeWithZone #in_time_zone defaults to Time.zone. Removing now unneeded #in_current_time_zone. ActiveRecord time zone aware attributes updated to use #in_time_zone
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9047 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activesupport/lib/active_support/time_with_zone.rb')
-rw-r--r--activesupport/lib/active_support/time_with_zone.rb9
1 files changed, 2 insertions, 7 deletions
diff --git a/activesupport/lib/active_support/time_with_zone.rb b/activesupport/lib/active_support/time_with_zone.rb
index 984b1e43cb..82af1653ef 100644
--- a/activesupport/lib/active_support/time_with_zone.rb
+++ b/activesupport/lib/active_support/time_with_zone.rb
@@ -29,17 +29,12 @@ module ActiveSupport
@period ||= time_zone.period_for_utc(@utc)
end
- # Returns the simultaneous time in the specified zone
- def in_time_zone(new_zone)
+ # Returns the simultaneous time in Time.zone, or the specified zone
+ def in_time_zone(new_zone = ::Time.zone)
return self if time_zone == new_zone
utc.in_time_zone(new_zone)
end
- # Returns the simultaneous time in Time.zone
- def in_current_time_zone
- utc.in_current_time_zone
- end
-
# Returns a Time.local() instance of the simultaneous time in your system's ENV['TZ'] zone
def localtime
utc.getlocal