Exception: Graphiti::Errors::InvalidBelongsToResourceIds

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

Instance Method Summary collapse

Constructor Details

#initialize(resource_class, value) ⇒ InvalidBelongsToResourceIds

Returns a new instance of InvalidBelongsToResourceIds.



695
696
697
698
# File 'lib/graphiti/errors.rb', line 695

def initialize(resource_class, value)
  @resource_class = resource_class
  @value = value
end

Instance Method Details

#message ⇒ Object



700
701
702
703
704
705
706
707
708
709
710
# File 'lib/graphiti/errors.rb', line 700

def message
  "    \#{@resource_class.name}: belongs_to_resource_ids_by_default must be one of :foreign_key, :always, or :never. Got \#{@value.inspect}.\n\n      :foreign_key - render resource ids wherever the foreign key already holds the related id (default)\n      :always      - render them for every belongs_to, loading the association when the foreign key cannot answer\n      :never       - render none\n\n    To render resource ids for a collection, ask for it one relationship at a time with `resource_ids: true`.\n  MSG\nend\n"