aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/attribute_methods/time_zone_conversion.rb
diff options
context:
space:
mode:
authorPaul Gillard <paulmgillard@gmail.com>2009-08-04 16:19:19 -0500
committerJoshua Peek <josh@joshpeek.com>2009-08-04 16:19:19 -0500
commitc30a0ce3c8f88baebd369180a6e221706e2b5cbf (patch)
tree7ec8f230d8c0f87f889b1b83f0668b12dad6d6e9 /activerecord/lib/active_record/attribute_methods/time_zone_conversion.rb
parentaad5a30bf25d8a3167afd685fc91c99f4f09cc57 (diff)
downloadrails-c30a0ce3c8f88baebd369180a6e221706e2b5cbf.tar.gz
rails-c30a0ce3c8f88baebd369180a6e221706e2b5cbf.tar.bz2
rails-c30a0ce3c8f88baebd369180a6e221706e2b5cbf.zip
Modified ActiveRecord::AttributeMethods to allow classes to specify attribute method prefixes and/or suffixes. Previously only suffixes were allowed.
Signed-off-by: Joshua Peek <josh@joshpeek.com>
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.rb4
1 files changed, 2 insertions, 2 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..b9cfe59971 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)
@@ -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)