Skip to content
This repository has been archived by the owner on Feb 19, 2022. It is now read-only.

Fix nested associations after a change in 0.10.0 #6

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

mwoskowicz
Copy link

@mwoskowicz mwoskowicz commented Sep 23, 2021

Let's say we have a model

class User < ApplicationRecord
has_one :logo, class_name: "UsersArea::Logo"
accepts_nested_attributes_for :logo
end

In the 0.10.0 it tries to constantize a class based on the association name itsself, which breaks if association name does not correspond directly to the class name. In this example it tries to find class Logo instead of UsersArea::Logo

This change seems to have fixed that problem for us at least. It would be great if someone could verify in their project :)

@mwoskowicz mwoskowicz closed this Sep 23, 2021
@mwoskowicz mwoskowicz reopened this Sep 23, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant