Exception: Parse::UnfetchedFieldAccessError

Inherits:
Error
  • Object
show all
Defined in:
lib/parse/model/core/errors.rb

Overview

Raised when attempting to access a field that was not fetched on a partially fetched object when autofetch has been disabled.

Instance Attribute Summary collapse

Attributes inherited from Error

#code

Instance Method Summary collapse

Constructor Details

#initialize(field_name, object_class) ⇒ UnfetchedFieldAccessError

Returns a new instance of UnfetchedFieldAccessError.



31
32
33
34
35
36
# File 'lib/parse/model/core/errors.rb', line 31

def initialize(field_name, object_class)
  @field_name = field_name
  @object_class = object_class
  super("Attempted to access unfetched field '#{field_name}' on #{object_class} with autofetch disabled. " \
        "Either fetch the object first, include this field in the keys parameter, or enable autofetch.")
end

Instance Attribute Details

#field_nameObject (readonly)

Returns the value of attribute field_name.



29
30
31
# File 'lib/parse/model/core/errors.rb', line 29

def field_name
  @field_name
end

#object_classObject (readonly)

Returns the value of attribute object_class.



29
30
31
# File 'lib/parse/model/core/errors.rb', line 29

def object_class
  @object_class
end