Exception: Graphiti::Errors::PolymorphicResourceChildNotFound
Instance Method Summary collapse
-
#initialize(resource_class, type: nil, model: nil) ⇒ PolymorphicResourceChildNotFound
constructor
A new instance of PolymorphicResourceChildNotFound.
- #message ⇒ Object
- #model_message ⇒ Object
- #type_message ⇒ Object
Constructor Details
#initialize(resource_class, type: nil, model: nil) ⇒ PolymorphicResourceChildNotFound
Returns a new instance of PolymorphicResourceChildNotFound.
441 442 443 444 445 |
# File 'lib/graphiti/errors.rb', line 441 def initialize(resource_class, type: nil, model: nil) @resource_class = resource_class @model = model @type = type end |
Instance Method Details
#message ⇒ Object
447 448 449 |
# File 'lib/graphiti/errors.rb', line 447 def @model ? : end |
#model_message ⇒ Object
451 452 453 454 455 456 457 458 459 460 |
# File 'lib/graphiti/errors.rb', line 451 def " \#{@resource_class}: Tried to find Resource subclass with model \#{@model.class}, but nothing found!\n\n Make sure all your child classes are assigned and associated to the right models:\n\n # One of these should be assocated to model \#{@model.class}:\n self.polymorphic = ['Subclass1Resource', 'Subclass2Resource']\n MSG\nend\n" |
#type_message ⇒ Object
462 463 464 465 466 467 468 469 470 471 |
# File 'lib/graphiti/errors.rb', line 462 def " \#{@resource_class}: Tried to find Resource subclass with model \#{@model.class}, but nothing found!\n\n Make sure all your child classes are assigned and associated to the right models:\n\n # One of these should be assocated to model \#{@model.class}:\n self.polymorphic = ['Subclass1Resource', 'Subclass2Resource']\n MSG\nend\n" |