提交 370f4f51 编写于 作者: S Sunny Ripert

Applied list conventions in AR::Base

上级 5bd18429
...@@ -633,8 +633,8 @@ def create(attributes = nil, &block) ...@@ -633,8 +633,8 @@ def create(attributes = nil, &block)
# #
# ==== Attributes # ==== Attributes
# #
# * +id+ This should be the id or an array of ids to be updated # * +id+ - This should be the id or an array of ids to be updated.
# * +attributes+ This should be a Hash of attributes to be set on the object, or an array of Hashes. # * +attributes+ - This should be a Hash of attributes to be set on the object, or an array of Hashes.
# #
# ==== Examples # ==== Examples
# #
...@@ -663,7 +663,7 @@ def update(id, attributes) ...@@ -663,7 +663,7 @@ def update(id, attributes)
# #
# ==== Attributes # ==== Attributes
# #
# * +id+ Can be either an Integer or an Array of Integers # * +id+ - Can be either an Integer or an Array of Integers.
# #
# ==== Examples # ==== Examples
# #
...@@ -686,7 +686,7 @@ def delete(id) ...@@ -686,7 +686,7 @@ def delete(id)
# #
# ==== Attributes # ==== Attributes
# #
# * +id+ Can be either an Integer or an Array of Integers # * +id+ - Can be either an Integer or an Array of Integers.
# #
# ==== Examples # ==== Examples
# #
...@@ -709,10 +709,10 @@ def destroy(id) ...@@ -709,10 +709,10 @@ def destroy(id)
# #
# ==== Attributes # ==== Attributes
# #
# * +updates+ A String of column and value pairs that will be set on any records that match conditions # * +updates+ - A String of column and value pairs that will be set on any records that match conditions.
# * +conditions+ An SQL fragment like "administrator = 1" or [ "user_name = ?", username ]. # * +conditions+ - An SQL fragment like "administrator = 1" or [ "user_name = ?", username ].
# See conditions in the intro for more info. # See conditions in the intro for more info.
# * +options+ Additional options are <tt>:limit</tt> and/or <tt>:order</tt>, see the examples for usage. # * +options+ - Additional options are <tt>:limit</tt> and/or <tt>:order</tt>, see the examples for usage.
# #
# ==== Examples # ==== Examples
# #
...@@ -741,7 +741,7 @@ def update_all(updates, conditions = nil, options = {}) ...@@ -741,7 +741,7 @@ def update_all(updates, conditions = nil, options = {})
# #
# ==== Attributes # ==== Attributes
# #
# * +conditions+ Conditions are specified the same way as with +find+ method. # * +conditions+ - Conditions are specified the same way as with +find+ method.
# #
# ==== Example # ==== Example
# #
...@@ -759,7 +759,7 @@ def destroy_all(conditions = nil) ...@@ -759,7 +759,7 @@ def destroy_all(conditions = nil)
# #
# ==== Attributes # ==== Attributes
# #
# * +conditions+ Conditions are specified the same way as with +find+ method. # * +conditions+ - Conditions are specified the same way as with +find+ method.
# #
# ==== Example # ==== Example
# #
...@@ -779,7 +779,7 @@ def delete_all(conditions = nil) ...@@ -779,7 +779,7 @@ def delete_all(conditions = nil)
# #
# ==== Attributes # ==== Attributes
# #
# * +sql+ An SQL statement which should return a count query from the database, see the example below # * +sql+ - An SQL statement which should return a count query from the database, see the example below.
# #
# ==== Examples # ==== Examples
# #
...@@ -797,10 +797,9 @@ def count_by_sql(sql) ...@@ -797,10 +797,9 @@ def count_by_sql(sql)
# #
# ==== Attributes # ==== Attributes
# #
# * +id+ The id of the object you wish to update a counter on # * +id+ - The id of the object you wish to update a counter on.
# * +counters+ An Array of Hashes containing the names of the fields # * +counters+ - An Array of Hashes containing the names of the fields
# to update as keys and the amount to update the field by as # to update as keys and the amount to update the field by as values.
# values
# #
# ==== Examples # ==== Examples
# #
...@@ -828,8 +827,8 @@ def update_counters(id, counters) ...@@ -828,8 +827,8 @@ def update_counters(id, counters)
# #
# ==== Attributes # ==== Attributes
# #
# * +counter_name+ The name of the field that should be incremented # * +counter_name+ - The name of the field that should be incremented.
# * +id+ The id of the object that should be incremented # * +id+ - The id of the object that should be incremented.
# #
# ==== Examples # ==== Examples
# #
...@@ -845,8 +844,8 @@ def increment_counter(counter_name, id) ...@@ -845,8 +844,8 @@ def increment_counter(counter_name, id)
# #
# ==== Attributes # ==== Attributes
# #
# * +counter_name+ The name of the field that should be decremented # * +counter_name+ - The name of the field that should be decremented.
# * +id+ The id of the object that should be decremented # * +id+ - The id of the object that should be decremented.
# #
# ==== Examples # ==== Examples
# #
...@@ -934,8 +933,8 @@ def readonly_attributes ...@@ -934,8 +933,8 @@ def readonly_attributes
# #
# ==== Attributes # ==== Attributes
# #
# * +attr_name+ The field name that should be serialized # * +attr_name+ - The field name that should be serialized.
# * +class_name+ Optional, class name that the object type should be equal to # * +class_name+ - Optional, class name that the object type should be equal to.
# #
# ==== Example # ==== Example
# # Serialize a preferences attribute # # Serialize a preferences attribute
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册