Exception: Graphiti::Errors::ResourceNotFound

Inherits:
Base
  • Object
show all
Defined in:
lib/graphiti/errors.rb

Instance Method Summary collapse

Constructor Details

#initialize(resource_class, sideload_name, tried) ⇒ ResourceNotFound

Returns a new instance of ResourceNotFound.



755
756
757
758
759
# File 'lib/graphiti/errors.rb', line 755

def initialize(resource_class, sideload_name, tried)
  @resource_class = resource_class
  @sideload_name = sideload_name
  @tried = tried
end

Instance Method Details

#messageObject



761
762
763
764
765
766
767
768
769
770
771
# File 'lib/graphiti/errors.rb', line 761

def message
  <<~MSG
    Could not find resource class for sideload '#{@sideload_name}' on Resource '#{@resource_class.name}'!

    Tried to find classes: #{@tried.join(", ")}

    If this follows a non-standard naming convention, use the :resource option to pass it directly:

    has_many :comments, resource: SpecialCommentResource
  MSG
end