Open jagthedrummer opened 1 month ago
Just trying to look into this and it looks like this line in the JoinModelScaffolder
is what's responsible for getting the has_many
declaration wrong.
I think the problem is probably related to the fact that the Scaffolding::ClassNamesTransformer
only deals with model/class names and doesn't account for the fact that a relationship might use different names.
I first user super scaffolding to create a
Task
model:Then I want to make it so that a
Task
can be assigned to manyMembership
s under the nameassigned_to_memberships
. (Just usingmemberships
won't work because I also want to have anapprovable_by_memberships
relationship that also points to theMembership
model.)I tried generating a join model by doing this:
That results in
Task
getting updated with these lines:But I would expect it to be more like this given the names that I'm using:
It also generates a
valid_tasks
method inTasks::Assignment
that is defined like this:But the
Membership
model was not updated to have avalid_tasks
method. And again, based on the naming that I'm using I'd expect it to beassigned_to_memberships.valid_tasks
.