Skip to content

id_method_name not respected with polymorphic association #382

Open
@doits

Description

@doits

Version: 1.5

Without polymorphic association, I can do:

  belongs_to(
    :event,
    id_method_name: :event_uuid,
  )

It correctly uses event_uuid as the method to get the id of the association.

With polymorphic though:

  belongs_to(
    :resource,
    id_method_name: :resource_uuid,
    polymorphic: true
  )

id_method_name has no effect, it always uses resource_id as the id. I think this is a bug?

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