# File lib/dm-core/property.rb, line 447 def lazy_load(resource) # It is faster to bail out at at a new_record? rather than to process # which properties would be loaded and then not load them. return if resource.new_record? || resource.attribute_loaded?(name) # If we're trying to load a lazy property, load it. Otherwise, lazy-load # any properties that should be eager-loaded but were not included # in the original :fields list contexts = lazy? ? name : model.eager_properties(resource.repository.name) resource.send(:lazy_load, contexts) end