Exception: Pragma::Decorator::Association::UnexpandedAssociationParent

Inherits:
ExpansionError
  • Object
show all
Defined in:
lib/pragma/decorator/association/errors.rb

Overview

This is raised when the user expanded a nested association without expanding its parent.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(child, parent) ⇒ UnexpandedAssociationParent

Initializes the error.

Parameters:

  • child (String|Symbol)

    the name of the child association

  • parent (String|Symbol)

    the name of the parent association



38
39
40
41
42
43
# File 'lib/pragma/decorator/association/errors.rb', line 38

def initialize(child, parent)
  @child = child
  @parent = parent

  super "The '#{child}' association is expanded, but its parent '#{parent}' is not."
end

Instance Attribute Details

#childString|Symbol (readonly)

Returns the name of the child association.

Returns:

  • (String|Symbol)

    the name of the child association



32
33
34
# File 'lib/pragma/decorator/association/errors.rb', line 32

def child
  @child
end

#parentObject (readonly)

Returns the value of attribute parent.



32
# File 'lib/pragma/decorator/association/errors.rb', line 32

attr_reader :child, :parent