blueprinter_schema 1.6.0 → 1.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9cfb85c67fa7ef32587a53be7c9a0af7fac5d7073355c104ad4e5463949ba846
4
- data.tar.gz: 07161f373f93501eb0a053800549ebc39ce7012d58706fd2fcd6d998b69f3b5e
3
+ metadata.gz: b4bead8620839a075c510b0f243d4e8c3d8ee38a3f5025e493bf0c3f59d01519
4
+ data.tar.gz: 6ee11ed05b4b0337af6e4276e02cee4ce546eb47f7de4d36ff024c6af229b356
5
5
  SHA512:
6
- metadata.gz: 3378f86662ed59bfa7b929d618b42e6507c61b10520797b738e0f1a8b79488b815d26f0ba64f5a3cdc7ede9071c03a00f93e3d2d56588c47cee457d5b9446486
7
- data.tar.gz: c36d3d50ccc702382c2bdc55b77b30c53e048e340384b0d75119ec8bc2ab097d940a475809355a7107fe59389b47b35c18900813586891d403544a709bd6318b
6
+ metadata.gz: 807bc1360008eb60eaf2df3c55f1287dc90d11fc2d6bc71f4abe68153ab678fd267b14382b581adfbbd5e728f262183a6434901c50d4086de8f4b815248a558b
7
+ data.tar.gz: e18240976adffd74caff957b4be334c72acd88e0286f03fd20ff60f118b5e1e0e6a94be6dedc689216fa761f1a588e33c359eaa1ff3fd680a305aacf65fc0e35
@@ -144,12 +144,12 @@ module BlueprinterSchema
144
144
  type
145
145
  end
146
146
 
147
- def association_to_json_schema(association) # rubocop:disable Metrics/CyclomaticComplexity
147
+ def association_to_json_schema(association)
148
148
  blueprint_class = association.options[:blueprint]
149
149
 
150
150
  return { 'type' => 'object' } unless blueprint_class
151
151
 
152
- ar_association = @model&.reflect_on_association(association.name)
152
+ ar_association = @model.try(:reflect_on_association, association.name)
153
153
  is_collection = ar_association ? ar_association.collection? : association.options[:collection]
154
154
 
155
155
  view = association.options[:view] || :default
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module BlueprinterSchema
4
- VERSION = '1.6.0'
4
+ VERSION = '1.6.1'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: blueprinter_schema
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.0
4
+ version: 1.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - thisismydesign