Doc fixes
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3782 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
parent
b8134000c4
commit
c450a36f16
@ -261,7 +261,7 @@ class Base
|
|||||||
cattr_accessor :allow_concurrency
|
cattr_accessor :allow_concurrency
|
||||||
|
|
||||||
# Modern REST web services often need to submit complex data to the web application.
|
# Modern REST web services often need to submit complex data to the web application.
|
||||||
# the param_parsers hash lets you register handlers wich will process the http body and add parameters to the
|
# The param_parsers hash lets you register handlers wich will process the http body and add parameters to the
|
||||||
# @params hash. These handlers are invoked for post and put requests.
|
# @params hash. These handlers are invoked for post and put requests.
|
||||||
#
|
#
|
||||||
# By default application/xml is enabled. a XmlNode class with the same param name as the root
|
# By default application/xml is enabled. a XmlNode class with the same param name as the root
|
||||||
@ -281,9 +281,7 @@ class Base
|
|||||||
# ActionController::Base.param_parsers['application/xml'] = :xml_simple
|
# ActionController::Base.param_parsers['application/xml'] = :xml_simple
|
||||||
# ActionController::Base.param_parsers['application/x-yaml'] = :yaml
|
# ActionController::Base.param_parsers['application/x-yaml'] = :yaml
|
||||||
#
|
#
|
||||||
@@param_parsers = {
|
@@param_parsers = { 'application/xml' => :xml_node }
|
||||||
'application/xml' => :xml_node
|
|
||||||
}
|
|
||||||
cattr_accessor :param_parsers
|
cattr_accessor :param_parsers
|
||||||
|
|
||||||
# Template root determines the base from which template references will be made. So a call to render("test/template")
|
# Template root determines the base from which template references will be made. So a call to render("test/template")
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
require 'rexml/document'
|
require 'rexml/document'
|
||||||
|
|
||||||
# SimpleXML like xml parser. Written by leon breet from the ruby on rails Mailing list
|
# SimpleXML like xml parser. Written by leon breet from the ruby on rails Mailing list
|
||||||
#
|
|
||||||
class XmlNode
|
class XmlNode
|
||||||
attr :node
|
attr :node
|
||||||
|
|
||||||
|
@ -528,6 +528,7 @@ def decrement_counter(counter_name, id)
|
|||||||
update_all "#{counter_name} = #{counter_name} - 1", "#{primary_key} = #{quote(id)}"
|
update_all "#{counter_name} = #{counter_name} - 1", "#{primary_key} = #{quote(id)}"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
# Attributes named in this macro are protected from mass-assignment, such as <tt>new(attributes)</tt> and
|
# Attributes named in this macro are protected from mass-assignment, such as <tt>new(attributes)</tt> and
|
||||||
# <tt>attributes=(attributes)</tt>. Their assignment will simply be ignored. Instead, you can use the direct writer
|
# <tt>attributes=(attributes)</tt>. 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:
|
# methods to do assignment. This is meant to protect sensitive attributes from being overwritten by URL/form hackers. Example:
|
||||||
@ -565,6 +566,7 @@ def accessible_attributes # :nodoc:
|
|||||||
read_inheritable_attribute("attr_accessible")
|
read_inheritable_attribute("attr_accessible")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
# Specifies that the attribute by the name of +attr_name+ should be serialized before saving to the database and unserialized
|
# 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
|
# 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.
|
# object must be of that class on retrieval or +SerializationTypeMismatch+ will be raised.
|
||||||
@ -577,6 +579,7 @@ def serialized_attributes
|
|||||||
read_inheritable_attribute("attr_serialized") or write_inheritable_attribute("attr_serialized", {})
|
read_inheritable_attribute("attr_serialized") or write_inheritable_attribute("attr_serialized", {})
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
# Guesses the table name (in forced lower-case) based on the name of the class in the inheritance hierarchy descending
|
# 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
|
# 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
|
# 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 @@ def table_name
|
|||||||
|
|
||||||
def reset_table_name
|
def reset_table_name
|
||||||
name = "#{table_name_prefix}#{undecorated_table_name(class_name_of_active_record_descendant(self))}#{table_name_suffix}"
|
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
|
name
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user