Benjamin Fleischer
5b953ff40f
Address concerns from #1018 commit c59668e
2016-02-08 17:55:15 -06:00
Benjamin Fleischer
c59668e7a8
Merge branch 'leandrocp-add-top-level-links'
...
Needs followup
- https://github.com/rails-api/active_model_serializers/pull/1018#discussion_r51733900
- https://github.com/rails-api/active_model_serializers/pull/1018#discussion_r51734779
- https://github.com/rails-api/active_model_serializers/pull/1018#discussion_r51735145
- https://github.com/rails-api/active_model_serializers/pull/1018#discussion_r51735218
2016-02-08 17:44:05 -06:00
Leandro Cesquini Pereira
37e4f1c30c
Update top-level link with PR #1247
...
update according rubocop rules
2016-02-03 10:16:22 -02:00
Leandro Cesquini Pereira
1844c162f1
Adds support for top-level links to JsonApi adapter
...
http://jsonapi.org/format/#document-top-level
fix failing tests
support for top-level links limited to jsonapi adapter
Move docs from README to docs/ dir
move links to json-api adapter & create Links class to hold links data
2016-02-03 10:16:22 -02:00
Lucas Hosseini
061f1c0f59
Add support for relationship-level links and meta.
2016-01-21 02:36:54 +01:00
Lucas Hosseini
30d8414cce
Add support for dynamic string-links in JsonApi adapter.
2016-01-15 14:36:42 +01:00
Lucas Hosseini
20a58d7f5c
Add support for JSON API deserialization (experimental).
2016-01-13 05:48:06 +01:00
Benjamin Fleischer
419faf03b9
Favor ActiveSupport::TestCase over Minitest::Test
...
- Better minitest 4/5 support
- Better DSL
- Already available with no changes
- Consistent interface
2015-12-22 10:35:51 -06:00
Benjamin Fleischer
ce17a1b305
[DOCS] Refactor, update, create documentation [ci skip]
2015-12-14 14:38:29 -06:00
Benjamin Fleischer
a9ce4fb766
Move caching initialization to Railtie
...
Also
- Add reference to config from ActiveModelSerializers.config
- correctly call super in FragmentCacheTest#setup
- rename test rails app from Foo to ActiveModelSerializers::RailsApplication
2015-11-25 21:56:01 -06:00
tchak
31172b1be5
rename context to serialization_context
2015-11-07 20:32:27 +01:00
Lucas Hosseini
3804dcc238
Add support for resource-level JSON API links.
2015-11-03 23:50:16 +01:00
L. Preston Sego III
17be650538
Revert "rename context to serialization_context and add url helpers"
2015-10-29 08:16:47 -04:00
L. Preston Sego III
a063cbea21
Merge pull request #1289 from tchak/serialization_context
...
rename context to serialization_context and add url helpers
2015-10-29 07:56:47 -04:00
Lucas Hosseini
13ef8fed1b
Fix fields option to restrict relationships as well.
2015-10-24 21:28:13 +02:00
tchak
d08ee5994f
rename context to serialization_context and add url helpers
2015-10-22 22:28:54 +02:00
Benjamin Fleischer
2c8b9b796d
Rename ArraySerializer to CollectionSerializer for clarity
2015-10-21 16:53:26 -05:00
Benjamin Fleischer
124faaa829
Add PORO serializable base class: ActiveModelSerializers::Model
2015-10-14 21:33:02 -05:00
João Moura
da7e6dc795
Merge pull request #1247 from beauby/jsonapi-toplevel-links
...
Add support for toplevel JSON API links.
2015-10-10 17:52:08 -03:00
Lucas Hosseini
eccb359cb9
Fix unnecessary nested serializers.
2015-10-08 18:13:58 +02:00
Lucas Hosseini
54303b6290
Add support for toplevel JSON API links.
2015-10-06 20:01:46 +02:00
Lucas Hosseini
f4bb4c81b0
Fix duplicate resources between data and included.
2015-10-06 17:25:27 +02:00
Lucas Hosseini
658810e6a0
Extract attributes filtering from serializer into adapter.
2015-10-05 08:21:26 +02:00
Benjamin Fleischer
a2bfe190e3
Merge pull request #1050 from bf4/json_api_member
...
Add top-level jsonapi member to JSON API adapter
2015-10-01 23:03:11 -05:00
Ivan Yurov
2dd569ae51
Add Serializer 'type' directive to control type field, for use by the JsonApi adapter
2015-10-01 22:48:57 -04:00
Benjamin Fleischer
9d7da8afc4
Add support for top level jsonapi member.
2015-10-01 21:22:49 -05:00
Lucas Hosseini
88785ea21e
Add failing test.
2015-09-21 07:11:23 +02:00
Benjamin Fleischer
19de5f7722
Introduce Adapter::Base
...
Breaking change:
- Adapters now inherit Adapter::Base
- 'Adapter' is now a module, no longer a class
Why?
- using a class as a namespace that you also inherit from is complicated and circular at time i.e.
buggy (see https://github.com/rails-api/active_model_serializers/pull/1177 )
- The class methods on Adapter aren't necessarily related to the instance methods, they're more
Adapter functions
- named `Base` because it's a Rails-ism
- It helps to isolate and highlight what the Adapter interface actually is
2015-09-20 12:26:04 -05:00
Lucas Hosseini
ce7a839f3d
Extended format for JSONAPI include option.
2015-09-13 22:45:47 +02:00
Lucas Hosseini
890003b305
Minor style improvements.
2015-09-07 09:06:17 +02:00
Lucas Hosseini
ebb05959d3
Merge remote-tracking branch 'upstream/master' into improve-tests
2015-09-07 09:03:17 +02:00
Benjamin Fleischer
228cc1c92a
Rubocop: Consistent spacing
2015-09-03 20:51:40 -05:00
Benjamin Fleischer
bdfe13c527
Style/StringLiterals single quote all the things
2015-09-03 20:50:45 -05:00
Lucas Hosseini
4bba16bf4e
Factor with_adapter + force cache clear before each test.
2015-08-28 17:00:24 +02:00
João Moura
64168cbecd
Merge pull request #1081 from beauby/jsonapi-singular-plural-config
...
Add configuration option to set resource type to singular/plural
2015-08-28 07:47:55 -03:00
Benjamin Fleischer
d315151e8a
Fix warnings
...
JRuby-specific: fix 'warning: (...) interpreted as grouped expression'
2015-08-26 09:22:02 -05:00
Lucas Hosseini
91235ba7bc
Add configuration option to set resource type to singular/plural with jsonapi.
2015-08-24 22:55:22 +02:00
Bruno Bacarini
d50262edbe
test pagination links the way the controller does
2015-08-20 11:32:03 -03:00
Bruno Bacarini
01eab3bdb4
send whole request context to model serializer
2015-08-19 10:48:48 -03:00
Bruno Bacarini
2c2f948fa0
Add pagination links automatically
...
Pagination links will be included in your response automatically as long
as the resource is paginated using Kaminari or WillPaginate
and if you are using a JSON-API adapter. The others adapters does not have this feature.
2015-08-18 19:04:04 -03:00
Bruno Bacarini
a41d90cce4
add self to pagination links
2015-08-18 19:04:04 -03:00
Bruno Bacarini
e0d050d2af
remove resource and options attr_reader from array_serialize
2015-08-18 19:04:03 -03:00
Bruno Bacarini
7be25fef14
include query_parameters on pagination links as well
2015-08-18 19:04:03 -03:00
Bruno Bacarini
e62a7d6f34
return complete URIs on pagination links
2015-08-18 19:04:03 -03:00
Bruno Bacarini
331218d1c3
add test to class of pagination links
2015-08-18 19:04:03 -03:00
Aaron Lerch
35c8f0d835
Update fragment cache to support namespaced objects
2015-08-17 17:12:30 -04:00
Mikhail Topolskiy
e8e4bdefd2
Use underscored json_root
2015-08-13 20:31:48 +03:00
João Moura
9817a5b595
updating tests
2015-07-23 02:11:34 -04:00
Rodrigo Ra
df63b59512
Add key option to serializer associations
2015-07-05 19:47:58 -03:00
Hugo Almeida
f25071ca70
Fixes virtual value not being used
2015-06-29 10:48:12 +09:00