class Graphiti::Errors::SingularSideload
Public Class Methods
Source
# File lib/graphiti/errors.rb, line 115 def initialize(sideload, parent_length) @sideload = sideload @parent_length = parent_length end
Public Instance Methods
Source
# File lib/graphiti/errors.rb, line 120 def message <<~MSG #{@sideload.parent_resource.class.name}: tried to sideload #{@sideload.name.inspect}, but more than one #{@sideload.parent_resource.model.name} was passed! This is because you marked the sideload #{@sideload.name.inspect} with single: true You might have done this because the sideload can only be loaded from a :show endpoint, and :index would be too expensive. Remove the single: true option to bypass this error. MSG end