graphiti 1.0.alpha.16 → 1.0.alpha.17

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
  SHA1:
3
- metadata.gz: d7cd1da91838a35ea701970bfa74cc01fa22d2b5
4
- data.tar.gz: 85c8af417325e68d85feac64c0d026fac4d838f4
3
+ metadata.gz: c143ac6d83e9869c7348b95bbe5dfb7d749f5350
4
+ data.tar.gz: 68962230d384cbc40bda6ebca1bc92694edf50b0
5
5
  SHA512:
6
- metadata.gz: 57bb072978dfbd7acdcb4e52bd24141a780608351dabb2b80365604bbe25ffec7f4777ca0061e08b0d048744a1c231e4f9ab5afd102702d6fb1fa9c8ebbfae81
7
- data.tar.gz: d8274209d83c00f0386c37029df7b836ad40351b4fec1852c849f33783f251427186aa4b1cc42da264399bc4eeb881b76ff7573145751fff5e180b6583221145
6
+ metadata.gz: d808239bc90833c4866ba40eb5f16e4f7ad711dcbcdf3ea2570603a339e46e65f2a574682e397d8ca901b2dc4365c6d54d51314706e0d18b89c9444096a4ea7c
7
+ data.tar.gz: 1aaaec7b0f0a5a179e595d8147f7eef5baa60f8690aa4731fcbbef1a0a9f392143b65ed9d21b50ed82f6157ca586ded103e565717f143c8383d1b3327ef385be
@@ -257,7 +257,7 @@ Only one resource can be associated to a given url/verb combination.
257
257
  end
258
258
  end
259
259
 
260
- class PolymorphicChildNotFound < Base
260
+ class PolymorphicResourceChildNotFound < Base
261
261
  def initialize(resource_class, model)
262
262
  @resource_class = resource_class
263
263
  @model = model
@@ -265,10 +265,11 @@ Only one resource can be associated to a given url/verb combination.
265
265
 
266
266
  def message
267
267
  <<-MSG
268
- #{@resource_class}: Tried to find subclass with model #{@model.class}, but nothing found!
268
+ #{@resource_class}: Tried to find Resource subclass with model #{@model.class}, but nothing found!
269
269
 
270
270
  Make sure all your child classes are assigned and associated to the right models:
271
271
 
272
+ # One of these should be assocated to model #{@model.class}:
272
273
  self.polymorphic = ['Subclass1Resource', 'Subclass2Resource']
273
274
  MSG
274
275
  end
@@ -369,7 +370,7 @@ Valid types are: #{Graphiti::Types.map.keys.inspect}
369
370
  end
370
371
  end
371
372
 
372
- class PolymorphicChildNotFound < Base
373
+ class PolymorphicSideloadChildNotFound < Base
373
374
  def initialize(sideload, name)
374
375
  @sideload = sideload
375
376
  @name = name
@@ -58,7 +58,7 @@ module Graphiti
58
58
  def resource_for_model(model)
59
59
  resource = children.find { |c| model.is_a?(c.model) }
60
60
  if resource.nil?
61
- raise Errors::PolymorphicChildNotFound.new(self, model)
61
+ raise Errors::PolymorphicResourceChildNotFound.new(self, model)
62
62
  else
63
63
  resource
64
64
  end
@@ -87,7 +87,7 @@ class Graphiti::Sideload::PolymorphicBelongsTo < Graphiti::Sideload::BelongsTo
87
87
  query = remove_invalid_sideloads(sideload.resource, query)
88
88
  sideload.resolve(group, query)
89
89
  else
90
- err = ::Graphiti::Errors::PolymorphicChildNotFound
90
+ err = ::Graphiti::Errors::PolymorphicSideloadChildNotFound
91
91
  raise err.new(self, group_name)
92
92
  end
93
93
  end
@@ -1,3 +1,3 @@
1
1
  module Graphiti
2
- VERSION = "1.0.alpha.16"
2
+ VERSION = "1.0.alpha.17"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: graphiti
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.alpha.16
4
+ version: 1.0.alpha.17
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lee Richmond