Skip to content

preload doesn't set the reverse association #389

@BrucePerens

Description

@BrucePerens

I have a URLPath model which belongs_to my Language model. Language has_one URLPath. I load both objects using URLPathQuery.new.path(path).preload_language.first
In the two resulting records, url_path.language is valid, but url_path.language.url_path is nil.

Preloading should set both sides of the association.

If I do something like this: URLPathQuery.new.path(path).preload_language.preload_url_path.first
then I get two copies of the URLPath record, and the url_path.language.url_path.language is nil.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions