Class ReactiveResource::Association::HasOneAssociation
In: lib/reactive_resource/association/has_one_association.rb
Parent: Object

Represents and resolves a has_one 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 has_one association.

Public Instance methods

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

headshot
returns the associated headshot

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]