143 Commits

Author SHA1 Message Date
Dillon Welch
1b3b533b40 Don't allocate variables if we're not going to use them 2018-04-26 19:33:20 -07:00
Dillon Welch
da275e189d Add default hash option to id_hash 2018-04-26 19:33:20 -07:00
Dillon Welch
ca0f600ed9 Use id_hash method instead of duplicating logic 2018-04-26 19:33:20 -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
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
Ankit Gupta
0008c5a165 Making a version file to manage version. Also not adding date as it defaults to current UTC date
https://ruby-doc.org/stdlib-2.2.3/libdoc/rubygems/rdoc/Gem/Specification.html#method-i-date
2018-04-20 15:26: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
fb7d01368a Integrate tests for #set_id and #attribute to object_serializer_class_methods_spec 2018-03-29 17:22:51 -07:00
Shuhei Kitagawa
0d8bbedcdd Change transform_method to accessor 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
Marten
18d30f228e Update .gitignore 2018-03-25 12:03:42 -07:00
Marten
9134930d76 Delete Gemfile.lock 2018-03-25 12:03:42 -07:00
Shuhei Kitagawa
b18da3da59 Remove unused variable from object_serializer_class_methods_spec 2018-03-21 07:39:55 -07:00
Rob Wise
fea384b4c6 update README to mention cache_key is required
see https://github.com/Netflix/fast_jsonapi/issues/99#issuecomment-374060813
2018-03-20 10:35:51 -07:00
Shishir Kakaraddi
2b0b3d94d1 Merge branch 'hotfix-1.1.1' 1.1.1 2018-03-19 13:18:04 -07:00
Shishir Kakaraddi
652ad51559 Bump version number to 1.1.1 2018-03-19 13:17:30 -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
Roberto Quintanilla
88553cf9ab Updated README with details about polymorphic associations 2018-03-18 22:32:01 -07:00
mnauage
1e6d127aec links doc 2018-03-18 22:31:02 -07:00
mnauage
ecd7bbc793 links key support 2018-03-18 22:31:02 -07:00
Shishir Kakaraddi
cf86cd871e merging with release-1.1 1.1 2018-03-18 09:37:54 -07:00
Shishir Kakaraddi
c40354e375 Bump version to 1.1.0 2018-03-18 09:04:59 -07:00
Shuhei Kitagawa
fa09c29190 Add document for for set_id method 2018-03-18 08:29:13 -07:00
Shuhei Kitagawa
a15232b47f Add tests for set_id method 2018-03-18 08:29:13 -07:00
Shuhei Kitagawa
43239aff49 Enable to set customized id column 2018-03-18 08:29:13 -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
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
41bffb1e20 Some docs for the instrumentation 2018-03-12 22:46:41 -07:00
Les Fletcher
8d905dbdfd taking a crack at the normalizers 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
Shuhei Kitagawa
93391aff6a Remove redundant to_s 2018-03-12 22:30:35 -07:00
Shuhei Kitagawa
b4eaa04c09 Add frozen_string_literal: true 2018-03-12 22:20:48 -07:00
Shuhei Kitagawa
8c630d9b1c Remove unused local variables from #relationships_hash 2018-03-12 22:20:09 -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