Class ReactiveResource::Association::BelongsToAssociation
In: lib/reactive_resource/association/belongs_to_association.rb
Parent: Object

Represents and resolves a belongs_to association.

Methods

Attributes

attribute  [R]  The attribute name this association represents
klass  [R]  The class this association is attached to
options  [R]  additional options passed in when the association was created

Public Class methods

Create a new belongs_to association.

Public Instance methods

Adds methods for belongs_to associations, to make dealing with these objects a bit more straightforward. If the attribute name is lawyer, it will add:

lawyer
returns the actual lawyer object (after doing a web request)
lawyer_id
returns the lawyer id
lawyer_id=
sets the lawyer id

A flattened list of attributes from the entire association belongs_to hierarchy, including this association‘s attribute.

Returns the class name of the target of the association. Based off of attribute unless class_name was passed in the options hash.

Called when this assocation is referenced. Finds and returns the target of this association.

[Validate]