Skip to content

Commit 54f11a9

Browse files
vipulnswardrafaelfranca
authored andcommitted
Merge pull request rails#25658 from will-in-wi/fix_rails_5_attributes_docs
Update Rails 5 release notes with syntax fixes. [ci skip]
1 parent 4088840 commit 54f11a9

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

guides/source/5_0_release_notes.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ It also changes the behavior of values passed to `ActiveRecord::Base.where`, whi
9191
without having to rely on implementation details or monkey patching.
9292

9393
Some things that you can achieve with this:
94+
9495
* The type detected by Active Record can be overridden.
9596
* A default can also be provided.
9697
* Attributes do not need to be backed by a database column.
@@ -131,16 +132,16 @@ model.attributes #=> {field_without_db_column: [1, 2, 3]}
131132
**Creating Custom Types:**
132133

133134
You can define your own custom types, as long as they respond
134-
to the methods defined on the value type. The method +deserialize+ or
135-
+cast+ will be called on your type object, with raw input from the
135+
to the methods defined on the value type. The method `deserialize` or
136+
`cast` will be called on your type object, with raw input from the
136137
database or from your controllers. This is useful, for example, when doing custom conversion,
137138
like Money data.
138139

139140
**Querying:**
140141

141142
When `ActiveRecord::Base.where` is called, it will
142143
use the type defined by the model class to convert the value to SQL,
143-
calling +serialize+ on your type object.
144+
calling `serialize` on your type object.
144145

145146
This gives the objects ability to specify, how to convert values when performing SQL queries.
146147

0 commit comments

Comments
 (0)