Lucas Hosseini
91c5cbe0b9
Cleanup add_included.
2015-09-01 17:57:30 +02:00
Lucas Hosseini
f7612f2542
Further refactor/streamline method names.
2015-09-01 16:52:43 +02:00
Lucas Hosseini
04012052a6
Fix 'id' -> :id.
2015-09-01 15:39:29 +02:00
Lucas Hosseini
c4faafdebc
Refactor resource_identifier.
2015-09-01 10:15:50 +02:00
Lucas Hosseini
d9c680599a
Refactor.
2015-09-01 01:41:29 +02:00
Lucas Hosseini
343f8b96bd
Fix bug preventing id overriding.
2015-08-31 06:25:20 +02:00
Lucas Hosseini
f95f7369f0
Refactor add_resource_relationship.
2015-08-31 03:24:03 +02:00
Lucas Hosseini
8482abfac7
Move id and json_api_type methods from Serializer to JsonApi.
2015-08-31 02:32:38 +02:00
Benjamin Fleischer
d315151e8a
Fix warnings
...
JRuby-specific: fix 'warning: (...) interpreted as grouped expression'
2015-08-26 09:22:02 -05:00
Bruno Bacarini
3c3578a9b8
improvements on how to get self link on pagination class
2015-08-19 11:16:53 -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
59ae84baba
exchange to a faster regex to get origina_url
2015-08-18 19:04:03 -03:00
Bruno Bacarini
77a8f66ad8
fix message on raise of pagination links class
2015-08-18 19:04:03 -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
1fe8b06986
exchange pagination class to inside json_api scope
2015-08-18 19:04:02 -03:00
João Moura
e384b65f5d
Merge pull request #1048 from bf4/cleanup_meta_in_adapter
...
Let FlattenJson adapter decide it doesn't include meta
2015-08-18 16:23:03 -03:00
Benjamin Fleischer
98d009a000
Let FlattenJson adapter decide it doesn't include meta
2015-08-18 15:13:21 -04:00
Aaron Lerch
35c8f0d835
Update fragment cache to support namespaced objects
2015-08-17 17:12:30 -04:00
João Moura
b4949fbc2a
Merge pull request #1049 from bf4/fix_json_api_adapter_serialable_hash
...
Fix incorrect s/options = {}/options ||= {}
2015-08-12 11:08:39 -03:00
Benjamin Fleischer
43e09c03de
Fix incorrect s/options = {}/options ||= {}
...
Introduced in #965 , surfaced in #1041
2015-08-11 17:08:09 -05:00
Josh Lane
033ce8e88d
allow for a type attribute
...
* "namespace" json_api specific type method
2015-08-11 08:33:05 -07:00
Josh Lane
4af98852b8
fix warning
...
* don't overshadow serializer variable
2015-08-11 08:32:20 -07:00
Артём Большаков
2952a332e0
Associations refactoring
...
* Move all associations related code from Serializer class to Associations module
* Introduce Reflection class hierarchy
* Introduce Association class
* Rid off Serializer#each_association
* Introduce Serializer#associations enumerator
2015-07-30 11:20:29 +03: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
Benjamin Fleischer
2d24dded14
serializable_hash and as_json should take options = nil
...
per ActiveModel::Serialization#serializable_hash
96bb004fc6/activemodel/lib/active_model/serialization.rb
def serializable_hash(options = nil)
options ||= {}
Otherwise, passing in nil to `as_json` or `serializable_hash`
makes things blow up when passing nil into attributes
2015-06-24 11:46:29 -05:00
João Moura
8e1214b4c5
force to use flattenJson when dealing with ArraySerializer
2015-06-15 02:48:39 -03:00
João Moura
b2f1947d4a
removing unseless root method
2015-06-14 17:24:48 -03:00
João Moura
2bf91a0c0e
updating adapters to follow new root logic
2015-06-14 03:25:20 -03:00
João Moura
1c3a180a20
disable root as flag option
2015-06-13 15:48:33 -03:00
João Moura
c8fcb60a5d
addung fragment_cache method to Adapter::Json
2015-06-13 15:48:33 -03:00
João Moura
5932da64ef
creating flatten_json adapter
2015-06-13 15:48:33 -03:00
João Moura
37114e9d5b
removing unnecessary root parameter on fragment cache
2015-06-13 15:48:33 -03:00
Chris Branson
d34bba07b9
Ensure the adapters honor a custom root option and include meta when required
2015-06-04 17:33:41 +01:00
João Moura
12adb2e6d4
Merge pull request #924 from navinpeiris/fragment-cache
...
Avoid unecessary calls to attribute methods when fragment caching
2015-05-27 14:55:31 -03:00
Navin Peiris
e0947fcbd4
Fixing issue where fragment cache calls attribute methods multiple times, even when they are supposed to be cached
2015-05-22 00:40:22 +05:30
Benedikt Deicke
4f576a1463
Adjusts JsonApi adapter to serialize relationships in a nested relationships hash
2015-05-21 16:35:35 +02:00
Benedikt Deicke
ca41901fb8
Adjusts JsonApi adapter to serialize attributes in a nested attributes hash
2015-05-21 16:23:01 +02:00
groyoh
5dcdfaaef3
Fixed a bug that appeared when json adapter serialize a nil association
2015-04-28 22:20:21 +02:00
Alexandre de Oliveira
168c36fc7d
Merge pull request #810 from joaomdmoura/fragment-cache
...
Adding Fragment Cache to AMS
2015-04-21 17:57:55 -03:00
João Moura
792fb8a905
Adding Fragment Cache to AMS
...
It's an upgrade based on the new Cache implementation #693 .
It allows to use the Rails conventions to cache
specific attributes or associations.
It's based on the Cache Composition implementation.
2015-04-05 18:19:57 -03:00
Yohan Robert
6a0564a241
Fixed a bug that appears when a nil association is included
2015-04-03 12:50:05 +02:00
Mateo Murphy
9aebc6cb11
Fix bugs with included resources
...
Make sure they're cached along with the including resource and remove duplicates
2015-03-24 20:07:25 -04:00
Mateo Murphy
90c7005c79
Don't store the root as we don't need it elsewhere
2015-03-23 12:38:15 -04:00
Mateo Murphy
294d06624f
Remove unused embed option
2015-03-22 20:43:56 -04:00
Mateo Murphy
33f3a88ba0
Implement included and id and type as per spec
2015-03-22 20:43:56 -04:00