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
Apologies for posting a question here, but I searched for a long time and couldn't find the answer.
I'm creating a slug on User that is scoped to Company. Everything works well, except generating paths/urls.
user_achievements_path(@user) generates /users/robert/achievements, but there are multiple roberts who belong to different companies, so the achievement action retrieves the wrong robert when it does a standard lookup of User.find(params[:id]).
Changing @user to @user.id works, but I'd rather not have to do that all over the place. Is there a more elegant solution?
Thank you.
The text was updated successfully, but these errors were encountered:
It sounds like the path is wrong, it should include the company in there, shouldn't it? How is that user_achievements_path generated? AFAIK that's not something that comes from mongoid-slug.
Apologies for posting a question here, but I searched for a long time and couldn't find the answer.
I'm creating a slug on
User
that is scoped toCompany
. Everything works well, except generating paths/urls.user_achievements_path(@user)
generates/users/robert/achievements
, but there are multiple roberts who belong to different companies, so the achievement action retrieves the wrong robert when it does a standard lookup ofUser.find(params[:id])
.Changing
@user
to@user.id
works, but I'd rather not have to do that all over the place. Is there a more elegant solution?Thank you.
The text was updated successfully, but these errors were encountered: