From c450a36f1676dd31f86957a1065e1b7e103aca09 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Sun, 5 Mar 2006 21:37:12 +0000 Subject: Doc fixes git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3782 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- activerecord/lib/active_record/base.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'activerecord/lib/active_record/base.rb') diff --git a/activerecord/lib/active_record/base.rb b/activerecord/lib/active_record/base.rb index 6778811f60..1203068aa8 100755 --- a/activerecord/lib/active_record/base.rb +++ b/activerecord/lib/active_record/base.rb @@ -528,6 +528,7 @@ module ActiveRecord #:nodoc: update_all "#{counter_name} = #{counter_name} - 1", "#{primary_key} = #{quote(id)}" end + # Attributes named in this macro are protected from mass-assignment, such as new(attributes) and # attributes=(attributes). Their assignment will simply be ignored. Instead, you can use the direct writer # methods to do assignment. This is meant to protect sensitive attributes from being overwritten by URL/form hackers. Example: @@ -565,6 +566,7 @@ module ActiveRecord #:nodoc: read_inheritable_attribute("attr_accessible") end + # Specifies that the attribute by the name of +attr_name+ should be serialized before saving to the database and unserialized # after loading from the database. The serialization is done through YAML. If +class_name+ is specified, the serialized # object must be of that class on retrieval or +SerializationTypeMismatch+ will be raised. @@ -577,6 +579,7 @@ module ActiveRecord #:nodoc: read_inheritable_attribute("attr_serialized") or write_inheritable_attribute("attr_serialized", {}) end + # Guesses the table name (in forced lower-case) based on the name of the class in the inheritance hierarchy descending # directly from ActiveRecord. So if the hierarchy looks like: Reply < Message < ActiveRecord, then Message is used # to guess the table name from even when called on Reply. The rules used to do the guess are handled by the Inflector class @@ -597,7 +600,7 @@ module ActiveRecord #:nodoc: def reset_table_name name = "#{table_name_prefix}#{undecorated_table_name(class_name_of_active_record_descendant(self))}#{table_name_suffix}" - set_table_name name + set_table_name(name) name end -- cgit v1.2.3