Exception: EcsRails::InvalidRelationship

Inherits:
InvalidComponent show all
Defined in:
lib/ecs_rails/errors.rb

Overview

Raised when relates_to is given a target that is not a concrete EcsRails::Entity. See RFC-0012 / ADR-0013.

A subclass of InvalidComponent on purpose. RFC-0012 left the choice open — reuse InvalidComponent, or add a dedicated class — and this gets both: the message is relationship-shaped (“relates_to :author expected … an entity”), while any existing rescue InvalidComponent and the RFC’s own contract test (raise_error(EcsRails::InvalidComponent)) still match, because a relationship is a component under the hood. See EcsRails::Relationships.