Skip to content

Commit 75fdbfa

Browse files
committed
Adapters inherit from Adapter::Base
1 parent 6509305 commit 75fdbfa

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

docs/general/adapters.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,19 +121,19 @@ If a symbol, then the adapter must be, e.g. `:great_example`,
121121

122122
There are two ways to register an adapter:
123123

124-
1) The simplest, is to subclass `ActiveModel::Serializer::Adapter`, e.g. the below will
124+
1) The simplest, is to subclass `ActiveModel::Serializer::Adapter::Base`, e.g. the below will
125125
register the `Example::UsefulAdapter` as `:useful_adapter`.
126126

127127
```ruby
128128
module Example
129-
class UsefulAdapter < ActiveModel::Serializer::Adapter
129+
class UsefulAdapter < ActiveModel::Serializer::Adapter::Base
130130
end
131131
end
132132
```
133133

134134
You'll notice that the name it registers is the class name underscored, not the full namespace.
135135

136-
Under the covers, when the `ActiveModel::Serializer::Adapter` is subclassed, it registers
136+
Under the covers, when the `ActiveModel::Serializer::Adapter::Base` is subclassed, it registers
137137
the subclass as `register(:useful_adapter, Example::UsefulAdapter)`
138138

139139
2) Any class can be registered as an adapter by calling `register` directly on the

0 commit comments

Comments
 (0)