Skip to content

Association, autoFetch() and the cache - what should happen? #684

Description

@stueynz

I'm building an animal pedigree management system - animal hasOne(animal) as Sire and hasOne(animal) as Dam; both with autoFetch=true.

If we get an Animal - we'll be returned the appropriate animal instance with the matching sire and dam properties correctly filled in. All three animals will now be in the cache.

If now do an independent get on the Sire or Dam we'll be returned the animal instances from the cache, but their Sire & Dam (the original animal's grandSire and grandDam) properties won't be filled in.

My gut reaction is that so-long as the autoFetchLimit hasn't been reached the retrieve from the cache should be capable of populating the missing association properties. Any opinions?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions