grape_serializer 0.1.1 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/grape_serializer.rb +5 -1
  3. metadata +6 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bff6bfc2f9daebaf7b839d06d8a7dc59734e8c859a19a8503ff20d606b69de58
4
- data.tar.gz: 10665fc048f7dce670298d5f199850aa3114ff2a1404ce0cb786e81c80451cd4
3
+ metadata.gz: 7c824e82b65e7a75c6e49b3030db849b5de1d8f76b8c13ffd27c824cfad28c43
4
+ data.tar.gz: 686c045c1d63d3e4f467c89e1d737d4b8ab4b2a7123d101d7739d2576708949b
5
5
  SHA512:
6
- metadata.gz: 8fbbb67bbcce96eadec2fe4141ce55da277f669f2ee5d2bc76323ef481bea762cc0ed951b4c28cd478b78ae41ac4ff694bd558d2bca031dbb0d110c43fbed3f7
7
- data.tar.gz: f1fd9e853fce60b99fc1c1965ac90b8f9217fefbbc9005a1eba38f659e49e75a37aeea50c177eab01e1f1475cfdb6acffa46c977aa45ac78bbb87c60c3b9cdf6
6
+ metadata.gz: 3e3f62693aafcaf7a71c008fe725ce32c3a910441b8e68f3a1d5de2cd0501b191e06ddf83eb32a10e3c7f040240863d0ccffa9ea38d1e0032683791d216c7205
7
+ data.tar.gz: b13ef389568173507f30784300e82c0fcae3407ee4dd081d333072952c31eecbe51433ac3b1f11850094a1f270c4dfbbe8ac2a0c06c8575ccbfcb0ccc3826f38
@@ -24,7 +24,11 @@ class GrapeSerializer
24
24
  protected
25
25
 
26
26
  def preload_associations(resource)
27
- ActiveRecord::Associations::Preloader.new.preload(resource, association_array)
27
+ if Rails::VERSION::MAJOR >= 7
28
+ ActiveRecord::Associations::Preloader.new(records: [resource].flatten, associations: association_array).call
29
+ else
30
+ ActiveRecord::Associations::Preloader.new.preload(resource, association_array)
31
+ end
28
32
  end
29
33
 
30
34
  def association_array
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: grape_serializer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - JiaRou Lee
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-04-12 00:00:00.000000000 Z
11
+ date: 2023-08-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: grape-entity
@@ -37,7 +37,9 @@ files:
37
37
  homepage: https://github.com/kdan-mobile-software-ltd/grape_serializer
38
38
  licenses:
39
39
  - MIT
40
- metadata: {}
40
+ metadata:
41
+ source_code_uri: https://github.com/kdan-mobile-software-ltd/grape_serializer
42
+ changelog_uri: https://github.com/kdan-mobile-software-ltd/grape_serializer/blob/master/CHANGELOG.md
41
43
  post_install_message:
42
44
  rdoc_options: []
43
45
  require_paths:
@@ -46,7 +48,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
46
48
  requirements:
47
49
  - - ">="
48
50
  - !ruby/object:Gem::Version
49
- version: '0'
51
+ version: '2.7'
50
52
  required_rubygems_version: !ruby/object:Gem::Requirement
51
53
  requirements:
52
54
  - - ">="