aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib
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 /activerecord/lib
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 'activerecord/lib')
-rw-r--r--activerecord/lib/active_record/attribute_methods.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/attribute_methods.rb b/activerecord/lib/active_record/attribute_methods.rb
index f976e70a06..46ecfc1969 100644
--- a/activerecord/lib/active_record/attribute_methods.rb
+++ b/activerecord/lib/active_record/attribute_methods.rb
@@ -161,7 +161,7 @@ module ActiveRecord
cached = @attributes_cache['#{attr_name}']
return cached if cached && !reload
time = read_attribute('#{attr_name}')
- @attributes_cache['#{attr_name}'] = time.acts_like?(:time) ? time.in_current_time_zone : time
+ @attributes_cache['#{attr_name}'] = time.acts_like?(:time) ? time.in_time_zone : time
end
EOV
evaluate_attribute_method attr_name, method_body
@@ -181,7 +181,7 @@ module ActiveRecord
def #{attr_name}=(time)
if time
time = time.to_time rescue time unless time.acts_like?(:time)
- time = time.in_current_time_zone if time.acts_like?(:time)
+ time = time.in_time_zone if time.acts_like?(:time)
end
write_attribute(:#{attr_name}, time)
end