Austin Matzko
be701f3e06
Don't attempt to dup a nil
2018-10-03 17:59:58 -04:00
Austin Matzko
1ab5cd387a
Don't share data_links among inherited serializers.
2018-10-03 17:51:37 -04:00
Shishir Kakaraddi
11b5255010
Merge pull request #313 from sakuraineed/fix_set_key_transform
...
Fix set_key_transform's set_type to give priority to pre-set value
2018-09-19 21:56:59 -07:00
Shishir Kakaraddi
fced516356
transforms type for polymorphic relationships too
2018-09-19 20:24:40 -07:00
Kenji Sakurai
6dc34cd4d4
Fix set_key_transform's set_type to give priority to pre-set value
2018-09-08 23:48:44 +09:00
Matthew Lanigan
5a70b1a686
Do not use ActiveSupport core extensions
...
Core extensions do not play well with many other gems; especially
considering that they only seem to be included for one `to_json` call,
they should be avoided.
2018-09-03 12:01:45 -07:00
François Pradel
955f4f234d
Add support for polymorphic includes
2018-08-31 19:17:45 -07:00
Alessandro Dal Grande
42d9203796
Fix confusing error when using include and no relationship was set
...
If you forgot to set any `has_many` in the serializer and tried to serialize with an `include` you would get:
```
NoMethodError (undefined method `[]' for nil:NilClass):
```
That is not very helpful. Setting the variable with a default case makes sure the right error message gets displayed.
2018-08-22 20:08:04 -07:00
Shishir Kakaraddi
a5414c6b8f
Merge pull request #280 from manojmj92/add_meta
...
Introduce the ability to add `meta` tag for every resource in the collection
2018-07-23 13:30:39 -07:00
Manoj M J
0c367d2574
Minor code refactor
2018-07-21 10:05:01 +05:30
Manoj M J
dd71bc15d6
Introduce the ability to add meta tag for every resource in the collection
2018-07-20 10:33:27 +05:30
Manoj M J
9c659839e4
Evaluate ids via the specified ‘id_method_name’ when relationships are evaluated via a block
2018-07-19 15:40:20 +05:30
Erol
fa194133fa
Use record type instead of reflected record type
2018-07-16 21:10:10 -07:00
Erol
e2bf5411a2
Set the record type for inherited serializers
2018-07-16 21:10:10 -07:00
Erol
ab652c4400
Remove unused code
2018-07-16 21:10:10 -07:00
Erol
a363c90bfb
Allow the serializer to return sparse fieldsets
2018-07-16 21:10:10 -07:00
Oleksiy Babich
ecb92f07f5
add is_collection parameter to force corresponding serialization ( #239 )
...
* add is_collection parameter to force corresponding serialization
* add documentation for is_collection purpose, behavior
and notes re. default autodetect logic
2018-07-03 19:35:06 -07:00
Kyle Reeves
af38b30179
remove options param from Link class
2018-07-03 19:33:34 -07:00
Kyle Reeves
699630d812
create link class
2018-07-03 19:33:34 -07:00
Kyle Reeves
30596c4488
move add_relationship to each class method
2018-07-03 19:33:34 -07:00
Kyle Reeves
7b23adddc4
working on new relationship class
2018-07-03 19:33:34 -07:00
Kyle Reeves
5558dcd703
allow conditional relationships
2018-07-03 19:33:34 -07:00
Darren Johnson
4a333d7276
Set type value when setting key transform
2018-06-21 18:40:24 -07:00
Trevor Hinesley
ba4e112829
Since attributes are an instantiated class now, renamed AttributeSerializer to Attribute
2018-06-21 18:38:42 -07:00
Trevor Hinesley
5c820695b3
Split attribute serialization into its own class
2018-06-21 18:38:42 -07:00
Trevor Hinesley
bad004fd42
Allow conditional attributes
2018-06-21 18:38:42 -07:00
Shishir Kakaraddi
a018f1d32f
minor fixes to data links feature
2018-05-20 15:08:47 -07:00
Shishir Kakaraddi
ea5296ac25
making object level links similar to attributes
2018-05-20 15:08:47 -07:00
Jodi Showers
74f27ccdf0
Links within data ( #161 )
2018-05-20 13:14:46 -07:00
Guillermo Iguaran
190bedaa05
Refactor compute_serializer_name to follow DRY
2018-05-14 17:54:33 -07:00
Shishir Kakaraddi
00d3aa4997
adding NotImplementedError when trying to include polymorphic relationships
2018-05-10 23:22:21 -07:00
Jodi Showers
3ebf34928c
Serialize nested includes ( #152 )
2018-05-10 21:17:32 -07:00
Shishir Kakaraddi
63f905ab36
adds params to relatinoship blocks and tests
2018-05-08 22:11:22 -07:00
Shuhei Kitagawa
e39de8c8c4
Enable to use block to define relationship
2018-05-06 10:26:38 -07:00
Shishir Kakaraddi
4523508c5b
inherits attributes, relationships and other settings from parent serializer
2018-05-05 19:12:45 -07:00
Carlos Solares
fe5ecb5b28
Use the serializer_key directly if it is not a symbol in relationships ( #198 )
2018-05-01 10:15:43 -07:00
Brandon Buck
a585497161
Add in options[:scope] and receiving scope in attribute blocks ( #153 )
2018-05-01 09:58:01 -07:00
Dillon Welch
a29b2c6184
Use alias for belongs_to because code is the same
...
Addresses https://github.com/Netflix/fast_jsonapi/issues/73
2018-04-26 10:37:44 -07:00
Dillon Welch
5428820d73
Add extra variables to cache to_sym calls
2018-04-26 10:37:44 -07:00
Dillon Welch
5b65608142
Move more of the logic inside the hash method
2018-04-26 10:37:44 -07:00
Dillon Welch
1f6fca522e
Compute relationship_hash on a separate line for clarity
2018-04-26 10:37:44 -07:00
Dillon Welch
e8f276c44f
Get rid of unnecessary freezes
2018-04-26 10:37:44 -07:00
Dillon Welch
f0cc24ed06
DRY up ObjectSerializer code
2018-04-26 10:37:44 -07:00
Shuhei Kitagawa
4fdf5a221c
Enable to set race_condition_ttl for cache_options
2018-04-08 22:53:31 -07:00
Shuhei Kitagawa
0d8bbedcdd
Change transform_method to accessor
2018-03-29 17:22:51 -07:00
mnauage
ecd7bbc793
links key support
2018-03-18 22:31:02 -07:00
Shuhei Kitagawa
8f4e716153
Define set_id method
2018-03-18 08:29:13 -07:00
Shishir Kakaraddi
00e960f883
adds the use_hyphen feature back and adds a deprecation warning
2018-03-17 18:33:55 -07:00
Les Fletcher
2da0b5bd87
rework of AS Notifications
2018-03-12 22:46:41 -07:00
Shuhei Kitagawa
b4eaa04c09
Add frozen_string_literal: true
2018-03-12 22:20:48 -07:00