Skip to content

Use canonical polymorphic names in association imports - #910

Open
OskarEichler wants to merge 1 commit into
zdennis:masterfrom
OskarEichler:codex/association-polymorphic-name
Open

Use canonical polymorphic names in association imports#910
OskarEichler wants to merge 1 commit into
zdennis:masterfrom
OskarEichler:codex/association-polymorphic-name

Conversation

@OskarEichler

Copy link
Copy Markdown
Contributor

Summary

Use the Rails polymorphic_name contract for direct collection imports, with the existing Rails 4.2 fallback. This aligns direct imports with normal assignment and the merged recursive-import correction.

Reproduction

STI owners and models with a custom polymorphic name currently store owner.class.name through direct association imports. Model, hash, and value forms now store the canonical name.

Verification

Focused STI/custom-name checks for all three forms; existing PostgreSQL 304 runs / 792 assertions and SQLite 225 / 563; syntax and targeted RuboCop pass. No tests or generated files were modified.

Compatibility

Non-polymorphic associations and default non-STI names are unchanged. Prepared with Codex assistance.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant