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.
# File activerecord/lib/active_record/associations/association.rb, line 137 def load_target if find_target? begin if IdentityMap.enabled? && association_class && association_class.respond_to?(:base_class) @target = IdentityMap.get(association_class, owner[reflection.foreign_key]) end rescue NameError nil ensure @target ||= find_target end end loaded! unless loaded? target rescue ActiveRecord::RecordNotFound reset end