Skip to content

belongs_to with custom foreign_key is breaking in 2.0.0.rc #3184

@maokomioko

Description

@maokomioko

Having a model with indirect association:
belongs_to :organization, primary_key: :org_number, foreign_key: :org_number

Belongs to association dropdowns return object's ID (as primary key) instead of customly specified key.

This looks like a regression from here:
be7d2f4#diff-3ccbdf28331673e0d29522ba324bddcfR81

image

Just to be sure I switched back to the earlier commit and dropdown values are filled with org_number as expected.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions