Skip to content

Commit 25bab2f

Browse files
aeroastrorafaelfrancap8
authored
[DOC] Clarify previous (type/value) in Activecord::Attributes attribute (rails#52208)
* Clarify previous (type/value) in Activecord::Attributes `attribute` * Update activerecord/lib/active_record/attributes.rb Co-authored-by: Petrik de Heus <[email protected]> --------- Co-authored-by: Rafael Mendonça França <[email protected]> Co-authored-by: Petrik de Heus <[email protected]>
1 parent 334d93a commit 25bab2f

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

activerecord/lib/active_record/attributes.rb

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,17 @@ module ClassMethods
2525
# column which this will persist to.
2626
#
2727
# +cast_type+ A symbol such as +:string+ or +:integer+, or a type object
28-
# to be used for this attribute. See the examples below for more
29-
# information about providing custom type objects.
28+
# to be used for this attribute. If this parameter is not passed, the previously
29+
# defined type (if any) will be used.
30+
# Otherwise, the type will be ActiveModel::Type::Value.
31+
# See the examples below for more information about providing custom type objects.
3032
#
3133
# ==== Options
3234
#
3335
# The following options are accepted:
3436
#
3537
# +default+ The default value to use when no value is provided. If this option
36-
# is not passed, the previous default value (if any) will be used.
38+
# is not passed, the previously defined default value (if any) on the superclass or in the schema will be used.
3739
# Otherwise, the default will be +nil+.
3840
#
3941
# +array+ (PostgreSQL only) specifies that the type should be an array (see the

0 commit comments

Comments
 (0)