Exception: Graphiti::Errors::UnselectedForeignKey
- Defined in:
- lib/graphiti/errors.rb
Instance Method Summary collapse
-
#initialize(resource_class, sideload, model) ⇒ UnselectedForeignKey
constructor
A new instance of UnselectedForeignKey.
- #message ⇒ Object
Constructor Details
#initialize(resource_class, sideload, model) ⇒ UnselectedForeignKey
Returns a new instance of UnselectedForeignKey.
744 745 746 747 748 |
# File 'lib/graphiti/errors.rb', line 744 def initialize(resource_class, sideload, model) @resource_class = resource_class @sideload = sideload @model = model end |
Instance Method Details
#message ⇒ Object
750 751 752 753 754 755 756 |
# File 'lib/graphiti/errors.rb', line 750 def <<~MSG #{@resource_class.name}: rendering resource linkage for relationship #{@sideload.name.inspect} reads ##{@sideload.foreign_key} off #{@model.class.name}, but that attribute is not loaded. Keep #{@sideload.foreign_key} in the selected columns, or turn linkage off with `resource_ids: false` on the relationship or `self.belongs_to_resource_ids_by_default = :never` on the resource. MSG end |