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.
488 489 490 491 492 |
# File 'lib/graphiti/errors.rb', line 488 def initialize(resource_class, type: nil, model: nil) @resource_class = resource_class @model = model @type = type end |
Instance Method Details
#message ⇒ Object
494 495 496 |
# File 'lib/graphiti/errors.rb', line 494 def @model ? : end |
#model_message ⇒ Object
498 499 500 501 502 503 504 505 506 507 |
# File 'lib/graphiti/errors.rb', line 498 def <<~MSG #{@resource_class}: Tried to find Resource subclass with model #{@model.class}, but nothing found! Make sure all your child classes are assigned and associated to the right models: # One of these should be assocated to model #{@model.class}: self.polymorphic = ['Subclass1Resource', 'Subclass2Resource'] MSG end |
#type_message ⇒ Object
509 510 511 512 513 514 515 516 517 518 |
# File 'lib/graphiti/errors.rb', line 509 def <<~MSG #{@resource_class}: Tried to find Resource subclass with model #{@model.class}, but nothing found! Make sure all your child classes are assigned and associated to the right models: # One of these should be assocated to model #{@model.class}: self.polymorphic = ['Subclass1Resource', 'Subclass2Resource'] MSG end |