method
load_target
v3.2.8 -
Show latest stable
- Class:
ActiveRecord::Associations::Association
load_target()public
Loads the target if needed and returns it.
This method is abstract in the sense that it relies on find_target, which is expected to be provided by descendants.
If the target is already loaded it is just returned. Thus, you can call load_target unconditionally to get the target.
ActiveRecord::RecordNotFound is rescued within the method, and it is not reraised. The proxy is reset and nil is the return value.