Exception: Graphiti::Errors::SingularSideload
- Defined in:
- lib/graphiti/errors.rb
Instance Method Summary collapse
-
#initialize(sideload, parent_length) ⇒ SingularSideload
constructor
A new instance of SingularSideload.
- #message ⇒ Object
Constructor Details
#initialize(sideload, parent_length) ⇒ SingularSideload
Returns a new instance of SingularSideload.
90 91 92 93 |
# File 'lib/graphiti/errors.rb', line 90 def initialize(sideload, parent_length) @sideload = sideload @parent_length = parent_length end |
Instance Method Details
#message ⇒ Object
95 96 97 98 99 100 101 102 103 104 105 |
# File 'lib/graphiti/errors.rb', line 95 def <<-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 |