Skip to content

Commit 35fb9de

Browse files
committed
Merge pull request #930 from joaomdmoura/master
Reverting PR #909
2 parents 12adb2e + a40df8f commit 35fb9de

File tree

4 files changed

+8
-10
lines changed

4 files changed

+8
-10
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ AMS does this through two components: **serializers** and **adapters**.
88
Serializers describe _which_ attributes and relationships should be serialized.
99
Adapters describe _how_ attributes and relationships should be serialized.
1010

11-
By default AMS will use the JsonApi Adapter that follows RC4 of the format specified in [jsonapi.org/format](http://jsonapi.org/format).
11+
By default AMS will use the **Json Adapter**. But we strongly advise you to use JsonApi Adapter that follows RC4 of the format specified in [jsonapi.org/format](http://jsonapi.org/format).
1212
Check how to change the adapter in the sections bellow.
1313

1414
# RELEASE CANDIDATE, PLEASE READ
@@ -50,17 +50,17 @@ end
5050
```
5151

5252
Generally speaking, you as a user of AMS will write (or generate) these
53-
serializer classes. If you want to use a different adapter, such as a normal Json adapter without the JsonApi conventions, you can
53+
serializer classes. If you want to use a different adapter, such as a JsonApi, you can
5454
change this in an initializer:
5555

5656
```ruby
57-
ActiveModel::Serializer.config.adapter = ActiveModel::Serializer::Adapter::Json
57+
ActiveModel::Serializer.config.adapter = ActiveModel::Serializer::Adapter::JsonApi
5858
```
5959

6060
or
6161

6262
```ruby
63-
ActiveModel::Serializer.config.adapter = :json
63+
ActiveModel::Serializer.config.adapter = :json_api
6464
```
6565

6666
You won't need to implement an adapter unless you wish to use a new format or

lib/active_model/serializer/configuration.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ module Configuration
66

77
included do |base|
88
base.config.array_serializer = ActiveModel::Serializer::ArraySerializer
9-
base.config.adapter = :json_api
9+
base.config.adapter = :json
1010
end
1111
end
1212
end

test/action_controller/adapter_selector_test.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ module ActionController
44
module Serialization
55
class AdapterSelectorTest < ActionController::TestCase
66
class MyController < ActionController::Base
7-
def render_using_the_initializer_defined_adapter
7+
def render_using_default_adapter
88
@profile = Profile.new({ name: 'Name 1', description: 'Description 1', comments: 'Comments 1' })
99
render json: @profile
1010
end
@@ -23,7 +23,7 @@ def render_skipping_adapter
2323
tests MyController
2424

2525
def test_render_using_default_adapter
26-
get :render_using_the_initializer_defined_adapter
26+
get :render_using_default_adapter
2727
assert_equal '{"name":"Name 1","description":"Description 1"}', response.body
2828
end
2929

test/fixtures/poro.rb

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
ActiveModel::Serializer.config.adapter = :json
2-
31
class Model
42
def initialize(hash={})
53
@attributes = hash
@@ -66,7 +64,7 @@ class ProfilePreviewSerializer < ActiveModel::Serializer
6664
Bio = Class.new(Model)
6765
Blog = Class.new(Model)
6866
Role = Class.new(Model)
69-
User = Class.new(Model)
67+
User = Class.new(Model)
7068
Location = Class.new(Model)
7169
Place = Class.new(Model)
7270

0 commit comments

Comments
 (0)