Exception: Parse::UnfetchedFieldAccessError
- 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
-
#field_name ⇒ Object
readonly
Returns the value of attribute field_name.
-
#object_class ⇒ Object
readonly
Returns the value of attribute object_class.
Attributes inherited from Error
Instance Method Summary collapse
-
#initialize(field_name, object_class) ⇒ UnfetchedFieldAccessError
constructor
A new instance of UnfetchedFieldAccessError.
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_name ⇒ Object (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_class ⇒ Object (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 |