Skip to content

Allow non-ID foreign keys #120

@brummett

Description

@brummett

Allow object accessors that link to a non-ID property for the remote object, and do the join in SQL if the data is in the DB. For example, return all the OtherObjects where their "their_name" property matches my "name" property.

Some possible syntaxes:

other_objects => {
    is => 'OtherObject',
    id_by => { name => \'their_name' },
}

or

other_objects => {
    is => 'OtherObject',
    where => { their_name => \'name' },
},

Before actually getting into the implementation, the latter is preferable. The accessor/mutator should follow the other indirect object mutators by automatically assigning the linking property if passed an OtherObject instance.

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