61 Commits

Author SHA1 Message Date
Shishir Kakaraddi
cd1bc0968e dont create a object for a has one relationship unnecessarily just to fetch id 2018-05-20 15:11:07 -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
Ryan O'Donnell
b090391551 Fix serialization for nested nil includes 2018-05-18 19:06:16 -07:00
Les Fletcher
077817ecec fix skylight normalizers issue 2018-05-16 18:43:05 -07:00
Shishir Kakaraddi
3fb975602b fixes some unnecessary performance test failures 2018-05-14 19:27:50 -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
5b64e90956 Add tests for block 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
Zino
faa8fe6caf Use string for serializer name 2018-05-02 10:22:22 -07:00
Shuhei Kitagawa
5d8e1ce9e7 Refactor tests for key_transform method 2018-05-01 23:28:07 -07:00
Brandon Buck
a585497161 Add in options[:scope] and receiving scope in attribute blocks (#153) 2018-05-01 09:58:01 -07:00
Konstantin
bc8996c04d fix ActiveRecord ConnectionNotEstablished when ActiveRecord isnt required in a project 2018-04-21 15:26:31 -07:00
Shuhei Kitagawa
af0aed4414 Clean up group_context.rb 2018-04-21 14:54:41 -07:00
Shuhei Kitagawa
fb7d01368a Integrate tests for #set_id and #attribute to object_serializer_class_methods_spec 2018-03-29 17:22:51 -07:00
Dmitriy Ivliev
1196db46e5 add exception for missing id method 2018-03-26 22:38:14 -07:00
Dmitriy Ivliev
c2e4c01bf1 fix behaviour for struct without id 2018-03-26 22:38:14 -07:00
Shuhei Kitagawa
cdfac8743d Refactor object serializer class methods spec (#134)
* Add object_serializer_class_methods_examples

* Change to require spec/shared/examples in every spec files

* Refactor object_serializer_class_methods_spec
2018-03-26 22:16:37 -07:00
Shuhei Kitagawa
4f3a903e64 Remove redundant fetch from ids_hash_from_record_and_relationship 2018-03-26 22:12:07 -07:00
Shishir Kakaraddi
e486a962e1 merge with master 2018-03-25 12:09:15 -07:00
Shuhei Kitagawa
b18da3da59 Remove unused variable from object_serializer_class_methods_spec 2018-03-21 07:39:55 -07:00
Ihor Dotsenko
270276d264 Fix bug with chaining rescues of FastJsonapi::MultiToJson::Result 2018-03-19 13:13:27 -07:00
sojan v jose
b387f94a13 Fix typo in the readme sample command (#131)
fix typo in the readme sample command
2018-03-19 12:53:24 -07:00
mnauage
ecd7bbc793 links key support 2018-03-18 22:31:02 -07:00
Shishir Kakaraddi
cf86cd871e merging with release-1.1 2018-03-18 09:37:54 -07:00
Shuhei Kitagawa
a15232b47f Add tests for 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
3a66a6f80b tear down the aliases 2018-03-12 22:46:41 -07:00
Les Fletcher
c75d7ceadc do two separate rspec runs because of require issue 2018-03-12 22:46:41 -07:00
Les Fletcher
2da0b5bd87 rework of AS Notifications 2018-03-12 22:46:41 -07:00
corinnekunze
f029cf737a Adding specs for #as_json method on ObjectSerializer and making sure non-included attributes are removed 2018-03-12 22:36:50 -07:00
Shuhei Kitagawa
1e40b7d2f7 Remove redundant GC.disable and GC.enable 2018-03-12 22:35:06 -07:00
Vlado Cingel
765eaa70d6 Title fixed for one spec 2018-03-12 22:18:17 -07:00
Sam Morgan
dfd215d3a1 91 allow includes strings (#93)
* add hash benchmarking to performance tests

* Add missing attribute in README example

* Disable GC before doing performance test

* Enable oj to AM for fair benchmark test

* add information on performance methodology

* add oss metadata

* Make an error that demonstrates [Issue

* Simple RSpec test that fails with a non-empty string but passes with a
non-empty symbol
* To run the test, rspec spec/lib/object_serializer_spec.rb

* Map includes to symbols if they are provided as strings

* Includes would fail with an ArgumentError unless they were explicitly
provided as symbols (see #97)
* This is solved by mapping the strings to symbols in the
ObjectSerializer initializer
* No real impact on performance here
2018-02-28 08:29:24 -08:00
Les Fletcher
08cee7b82d refactor performance specs 2018-02-16 17:30:51 -08:00
Guillermo Iguaran
eea4496e7b Add benchmarks for jsonapi-serializers library 2018-02-13 23:06:47 -08:00
Christopher Sansone
b30a53bc5f ability to customize rendering of attributes via a block (#54)
* add hash benchmarking to performance tests

* Add missing attribute in README example

* Disable GC before doing performance test

* Enable oj to AM for fair benchmark test

* ability to customize rendering of attributes via a block

* fixed attribute render spec

* minimized specs to specifially test this feature

* Update README to include attribute definitions

* Fixed syntax error

* Fixed merge issues
2018-02-09 08:59:07 -08:00
Roberto Quintanilla
6d516c217c Support for polymorphic associations (#64)
* add hash benchmarking to performance tests

* Add missing attribute in README example

* Disable GC before doing performance test

* Enable oj to AM for fair benchmark test

* Support for polymorphic associations

* Optional dictionary for polymorphic associations

* Added polymorphic record types memoization

* Updated performance tests for polymorphic examples to include jsonapi-rb
2018-02-08 22:18:46 -08:00
Benjamin Fleischer
b717ffeccf Let people choose their JSON serializer; JSON:API is not circular 2018-02-07 18:02:59 -08:00
jeremyjung
e7caa7afd5 Allow has_one nil association (#48)
* Allow has_one nil association

* add test for when has_one returns nil

* modify has_one extension method, add active record test

* Use try operator to support old rubies
2018-02-07 08:54:53 -08:00
Benjamin Fleischer
7843e411f6 Better usage of AMS::Model 2018-02-05 22:34:17 -08:00
Min.Kim
7b029991b8 Put all tests back 2018-02-05 22:30:24 -08:00
Min.Kim
22bea1505f Add jsonapi-rb test to benchmark suite 2018-02-05 22:30:24 -08:00
Min.Kim
4ccd40ac29 Add jsonapi data models for benchmark 2018-02-05 22:30:24 -08:00
Min.Kim
5861f27ebb Add jsonapi-rb / require for jsonapi-rb benchmark test 2018-02-05 22:30:24 -08:00
Shishir Kakaraddi
a3a989244b initial commit to allow the same kind of key transforms as AMS 2018-02-05 21:06:57 -08:00
Sergii Makagon
7f27543081 Refactoring 2018-02-04 17:12:18 -08:00
Min.Kim
0048bd2c80 Enable oj to AM for fair benchmark test 2018-02-04 17:12:18 -08:00