Class: Pakyow::Data::UnknownAssociation

Inherits:
Error
  • Object
show all
Defined in:
lib/pakyow/data/errors.rb

Instance Method Summary collapse

Instance Method Details

#contextual_messageObject



72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
# File 'lib/pakyow/data/errors.rb', line 72

def contextual_message
  if associations.any?
    String.new(
      "        The following associations exist for \#{@context.__object_name.name}:\n      MESSAGE\n    ).tap do |message|\n      associations.each do |association|\n        message << \"  * \#{association.name}\"\n      end\n    end\n  else\n    String.new(\n      <<~MESSAGE\n        No associations exist for \#{@context.__object_name.name}.\n      MESSAGE\n    )\n  end\nend\n"