class Pakyow::Data::UnknownAssociation

Public Instance Methods

contextual_message() click to toggle source
# File lib/pakyow/data/errors.rb, line 72
      def contextual_message
        if associations.any?
          String.new(
            <<~MESSAGE
              The following associations exist for #{@context.__object_name.name}:
            MESSAGE
          ).tap do |message|
            associations.each do |association|
              message << "  * #{association.name}"
            end
          end
        else
          String.new(
            <<~MESSAGE
              No associations exist for #{@context.__object_name.name}.
            MESSAGE
          )
        end
      end

Private Instance Methods

associations() click to toggle source
# File lib/pakyow/data/errors.rb, line 94
def associations
  @context.associations.values.flatten
end