Exception: Graphiti::Errors::PolymorphicSideloadChildNotFound
Instance Method Summary collapse
-
#initialize(sideload, name) ⇒ PolymorphicSideloadChildNotFound
constructor
A new instance of PolymorphicSideloadChildNotFound.
- #message ⇒ Object
Constructor Details
#initialize(sideload, name) ⇒ PolymorphicSideloadChildNotFound
Returns a new instance of PolymorphicSideloadChildNotFound.
655 656 657 658 |
# File 'lib/graphiti/errors.rb', line 655 def initialize(sideload, name) @sideload = sideload @name = name end |
Instance Method Details
#message ⇒ Object
660 661 662 663 664 665 666 667 668 669 670 671 672 673 |
# File 'lib/graphiti/errors.rb', line 660 def <<~MSG #{@sideload.parent_resource}: Found record with #{@sideload.grouper.field_name.inspect} == #{@name.inspect}, which is not registered! Register the behavior of different types like so: polymorphic_belongs_to #{@sideload.name.inspect} do group_by(#{@sideload.grouper.field_name.inspect}) do on(#{@name.to_sym.inspect}) <---- this is what's missing on(:foo).belongs_to :foo, resource: FooResource (long-hand example) end end MSG end |