Skip to content

Commit 312e115

Browse files
Reformat ::attribute args documentation [ci-skip]
1 parent a43db84 commit 312e115

File tree

1 file changed

+22
-16
lines changed

1 file changed

+22
-16
lines changed

activerecord/lib/active_record/attributes.rb

Lines changed: 22 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -22,28 +22,34 @@ module ClassMethods
2222
# your domain objects across much of Active Record, without having to
2323
# rely on implementation details or monkey patching.
2424
#
25-
# +name+ The name of the methods to define attribute methods for, and the
26-
# column which this will persist to.
25+
# ==== Parameters
2726
#
28-
# +cast_type+ A symbol such as +:string+ or +:integer+, or a type object
29-
# to be used for this attribute. If this parameter is not passed, the previously
30-
# defined type (if any) will be used.
31-
# Otherwise, the type will be ActiveModel::Type::Value.
32-
# See the examples below for more information about providing custom type objects.
27+
# [+name+]
28+
# The name of the methods to define attribute methods for, and the
29+
# column which this will persist to.
3330
#
34-
# ==== Options
31+
# [+cast_type+]
32+
# A symbol such as +:string+ or +:integer+, or a type object to be used
33+
# for this attribute. If this parameter is not passed, the previously
34+
# defined type (if any) will be used. Otherwise, the type will be
35+
# ActiveModel::Type::Value. See the examples below for more information
36+
# about providing custom type objects.
3537
#
36-
# The following options are accepted:
38+
# ==== Options
3739
#
38-
# +default+ The default value to use when no value is provided. If this option
39-
# is not passed, the previously defined default value (if any) on the superclass or in the schema will be used.
40-
# Otherwise, the default will be +nil+.
40+
# [+:default+]
41+
# The default value to use when no value is provided. If this option is
42+
# not passed, the previously defined default value (if any) on the
43+
# superclass or in the schema will be used. Otherwise, the default will
44+
# be +nil+.
4145
#
42-
# +array+ (PostgreSQL only) specifies that the type should be an array (see the
43-
# examples below).
46+
# [+:array+]
47+
# (PostgreSQL only) Specifies that the type should be an array. See the
48+
# examples below.
4449
#
45-
# +range+ (PostgreSQL only) specifies that the type should be a range (see the
46-
# examples below).
50+
# [+:range+]
51+
# (PostgreSQL only) Specifies that the type should be a range. See the
52+
# examples below.
4753
#
4854
# When using a symbol for +cast_type+, extra options are forwarded to the
4955
# constructor of the type object.

0 commit comments

Comments
 (0)