Skip to content

Commit

Permalink
Update top-level link with PR rails-api#1247
Browse files Browse the repository at this point in the history
  • Loading branch information
leandrocp committed Dec 23, 2015
1 parent ae547bf commit 3857076
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 139 deletions.
9 changes: 0 additions & 9 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,6 @@ This is the documentation of ActiveModelSerializers, it's focused on the **0.10.
- [Using ActiveModelSerializers Outside Of Controllers](howto/outside_controller_use.md)
- [How to add top-level links](howto/add_top_level_links.md) (```JSON-API``` only)

## Getting Help

If you find a bug, please report an [Issue](https://github.com/rails-api/active_model_serializers/issues/new).

If you have a question, please [post to Stack Overflow](http://stackoverflow.com/questions/tagged/active-model-serializers).

Thanks!
>>>>>>> Adds support for top-level links to JsonApi adapter
## Integrations

| Integration | Supported ActiveModelSerializers versions | Gem name and/or link
Expand Down
25 changes: 0 additions & 25 deletions lib/active_model/serializer/adapter/json_api/links.rb

This file was deleted.

8 changes: 4 additions & 4 deletions test/action_controller/serialization_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -272,15 +272,15 @@ def test_render_array_using_implicit_serializer_and_links
data: [
{
id: assigns(:profiles).first.id.to_s,
type: "profiles",
type: 'profiles',
attributes: {
name: "Name 1",
description: "Description 1"
name: 'Name 1',
description: 'Description 1'
}
}
],
links: {
self: "http://example.com/api/profiles/1"
self: 'http://example.com/api/profiles/1'
}
}

Expand Down
9 changes: 9 additions & 0 deletions test/adapter/json_api/links_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,15 @@ def test_toplevel_links
assert_equal(expected, hash[:links])
end

def test_nil_toplevel_links
hash = ActiveModel::SerializableResource.new(
@post,
adapter: :json_api,
links: nil
).serializable_hash
assert_equal(nil, hash[:links])
end

def test_resource_links
hash = serializable(@author, adapter: :json_api).serializable_hash
expected = {
Expand Down
101 changes: 0 additions & 101 deletions test/adapter/json_api/top_level_links_test.rb

This file was deleted.

0 comments on commit 3857076

Please sign in to comment.