You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I first user super scaffolding to create a Task model:
rails g super_scaffold Task Team name:text_field
Then I want to make it so that a Task can be assigned to many Memberships under the name assigned_to_memberships. (Just using memberships won't work because I also want to have an approvable_by_memberships relationship that also points to the Membership model.)
It also generates a valid_tasks method in Tasks::Assignment that is defined like this:
defvalid_tasksmembership.valid_tasksend
But the Membership model was not updated to have a valid_tasks method. And again, based on the naming that I'm using I'd expect it to be assigned_to_memberships.valid_tasks.
The text was updated successfully, but these errors were encountered:
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
.The text was updated successfully, but these errors were encountered: