class Pragma::Decorator::Association::InconsistentTypeError
This error is raised when an association's type is different from its type as reported by the model's reflection.
@author Alessandro Desantis
Public Class Methods
new(decorator:, reflection:, model_type:)
click to toggle source
Initializes the error.
@param decorator [Base] the decorator where the association is defined @param reflection [Reflection] the reflection of the inconsistent association @param model_type [Symbol|String] the real type of the association
Calls superclass method
# File lib/pragma/decorator/association/errors.rb, line 56 def initialize(decorator:, reflection:, model_type:) message = <<~MSG.tr("\n", ' ') #{decorator.class}: Association #{reflection.attribute} is defined as #{model_type} on the model, but as #{reflection.type} in the decorator. MSG super message end