diff options
author | Pratik Naik <pratiknaik@gmail.com> | 2008-05-25 12:29:00 +0100 |
---|---|---|
committer | Pratik Naik <pratiknaik@gmail.com> | 2008-05-25 12:29:00 +0100 |
commit | 98dc582742779081e71e697fcdf8d9ae2b421b16 (patch) | |
tree | f5680eef86e689a10d0f75434ba6a4e94829e439 /activerecord/lib/active_record/attribute_methods.rb | |
parent | 6277fd91133a3566333612857510d74de60d67f4 (diff) | |
download | rails-98dc582742779081e71e697fcdf8d9ae2b421b16.tar.gz rails-98dc582742779081e71e697fcdf8d9ae2b421b16.tar.bz2 rails-98dc582742779081e71e697fcdf8d9ae2b421b16.zip |
Merge docrails.
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
Diffstat (limited to 'activerecord/lib/active_record/attribute_methods.rb')
-rw-r--r-- | activerecord/lib/active_record/attribute_methods.rb | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/activerecord/lib/active_record/attribute_methods.rb b/activerecord/lib/active_record/attribute_methods.rb index d753778d52..fab16a4446 100644 --- a/activerecord/lib/active_record/attribute_methods.rb +++ b/activerecord/lib/active_record/attribute_methods.rb @@ -94,7 +94,7 @@ module ActiveRecord end # Checks whether the method is defined in the model or any of its subclasses - # that also derive from ActiveRecord. Raises DangerousAttributeError if the + # that also derive from Active Record. Raises DangerousAttributeError if the # method is defined by Active Record though. def instance_method_already_implemented?(method_name) method_name = method_name.to_s @@ -162,8 +162,8 @@ module ActiveRecord evaluate_attribute_method attr_name, "def #{attr_name}; unserialize_attribute('#{attr_name}'); end" end - # 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 + # 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_read_method_for_time_zone_conversion(attr_name) method_body = <<-EOV def #{attr_name}(reload = false) @@ -176,7 +176,7 @@ module ActiveRecord evaluate_attribute_method attr_name, method_body end - # Define an attribute ? method. + # Defines a predicate method <tt>attr_name?</tt>. def define_question_method(attr_name) evaluate_attribute_method attr_name, "def #{attr_name}?; query_attribute('#{attr_name}'); end", "#{attr_name}?" end @@ -185,7 +185,7 @@ module ActiveRecord evaluate_attribute_method attr_name, "def #{attr_name}=(new_value);write_attribute('#{attr_name}', new_value);end", "#{attr_name}=" end - # Defined for all datetime and timestamp attributes when time_zone_aware_attributes are enabled. + # 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_write_method_for_time_zone_conversion(attr_name) method_body = <<-EOV |