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.
595 596 597 598 |
# File 'lib/graphiti/errors.rb', line 595 def initialize(sideload, name) @sideload = sideload @name = name end |
Instance Method Details
#message ⇒ Object
600 601 602 603 604 605 606 607 608 609 610 611 612 613 |
# File 'lib/graphiti/errors.rb', line 600 def " \#{@sideload.parent_resource}: Found record with \#{@sideload.grouper.field_name.inspect} == \#{@name.inspect}, which is not registered!\n\n Register the behavior of different types like so:\n\n polymorphic_belongs_to \#{@sideload.name.inspect} do\n group_by(\#{@sideload.grouper.field_name.inspect}) do\n on(\#{@name.to_sym.inspect}) <---- this is what's missing\n on(:foo).belongs_to :foo, resource: FooResource (long-hand example)\n end\n end\n MSG\nend\n" |