Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add policy_class parameter to permitted_attributes function #742

Open
evgenyneu opened this issue Aug 3, 2022 · 3 comments · May be fixed by #825
Open

Add policy_class parameter to permitted_attributes function #742

evgenyneu opened this issue Aug 3, 2022 · 3 comments · May be fixed by #825
Labels
simmering undecided but generally optimistic

Comments

@evgenyneu
Copy link

Is it possible to add policy_class parameter to permitted_attributes function (similar to authorise)?

So I can call:

permitted_attributes(@post, :update, policy_class: MyPolicy)

This is necessary for my code where the name of the policy and record class are different.

@Merovex
Copy link

Merovex commented Oct 30, 2023

Should this be closed?

@hobbypunk90
Copy link

@Merovex sorry, that was my vault 😅 i cleaned my github a bit too fast... 😅

@Burgestrand
Copy link
Member

Knee-jerk reaction is yes!

A bit worried about the caching behaviour in this case. We could probably bypass the cache just we're already doing it in the other methods.

My main worry is that I'm not confident the cache behaviour as it is is a good behaviour, and we'd be spreading it. At least it would be somewhat consistent in itself though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
simmering undecided but generally optimistic
Projects
None yet
4 participants