aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/attribute_methods/time_zone_conversion.rb
diff options
context:
space:
mode:
authorEmilio Tagua <miloops@gmail.com>2009-08-05 14:52:07 -0300
committerEmilio Tagua <miloops@gmail.com>2009-08-05 14:52:07 -0300
commitae175a5354321fd64393b9e1f4080437ee3cdf74 (patch)
tree43a858b6f5c88ff418c97274f34abe833ff490ce /activerecord/lib/active_record/attribute_methods/time_zone_conversion.rb
parentf8eb4434d61fc1585c9b88dbb2d9159ea1f5b2fa (diff)
parentcfd421daa2b04216e27d666361eb4053020e027d (diff)
downloadrails-ae175a5354321fd64393b9e1f4080437ee3cdf74.tar.gz
rails-ae175a5354321fd64393b9e1f4080437ee3cdf74.tar.bz2
rails-ae175a5354321fd64393b9e1f4080437ee3cdf74.zip
Merge commit 'rails/master'
Diffstat (limited to 'activerecord/lib/active_record/attribute_methods/time_zone_conversion.rb')
-rw-r--r--activerecord/lib/active_record/attribute_methods/time_zone_conversion.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/activerecord/lib/active_record/attribute_methods/time_zone_conversion.rb b/activerecord/lib/active_record/attribute_methods/time_zone_conversion.rb
index 4438c7543e..a8e3e28a7a 100644
--- a/activerecord/lib/active_record/attribute_methods/time_zone_conversion.rb
+++ b/activerecord/lib/active_record/attribute_methods/time_zone_conversion.rb
@@ -15,7 +15,7 @@ module ActiveRecord
protected
# Defined for all +datetime+ and +timestamp+ attributes when +time_zone_aware_attributes+ are enabled.
# This enhanced read method automatically converts the UTC time stored in the database to the time zone stored in Time.zone.
- def define_attribute_method(attr_name)
+ def define_method_attribute(attr_name)
if create_time_zone_conversion_attribute?(attr_name, columns_hash[attr_name])
method_body = <<-EOV
def #{attr_name}(reload = false)
@@ -25,7 +25,7 @@ module ActiveRecord
@attributes_cache['#{attr_name}'] = time.acts_like?(:time) ? time.in_time_zone : time
end
EOV
- generated_methods.module_eval(method_body, __FILE__, __LINE__)
+ generated_attribute_methods.module_eval(method_body, __FILE__, __LINE__)
else
super
end
@@ -33,7 +33,7 @@ module ActiveRecord
# Defined for all +datetime+ and +timestamp+ attributes when +time_zone_aware_attributes+ are enabled.
# This enhanced write method will automatically convert the time passed to it to the zone stored in Time.zone.
- def define_attribute_method=(attr_name)
+ def define_method_attribute=(attr_name)
if create_time_zone_conversion_attribute?(attr_name, columns_hash[attr_name])
method_body = <<-EOV
def #{attr_name}=(time)
@@ -44,7 +44,7 @@ module ActiveRecord
write_attribute(:#{attr_name}, time)
end
EOV
- generated_methods.module_eval(method_body, __FILE__, __LINE__)
+ generated_attribute_methods.module_eval(method_body, __FILE__, __LINE__)
else
super
end