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

refactor: extract permitted_attribute_names from permitted_attributes #741

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

milgner
Copy link

@milgner milgner commented Jul 18, 2022

In one of our controllers where we use delegated types and nested attributes, we needed to check the permitted attributes separately for the delegated type. This splits the method permitted_attributes in two, separating finding the attribute names and looking them up in the params, so that the attribute names can be retrieved individually.

@Burgestrand
Copy link
Member

Hi! Sorry about you not receiving a reply at all. 2022 was hectic, so while we did have a brief look the reply slipped our minds.

I'm generally positive about this. I'm slightly worried about expanding our public API, especially when the namespace is shared between pundit and whatever application is using this.

I'm pondering if we either prefix this method pundit_permitted_attribute_names, or if we expose this only through the Pundit::Context. I need to simmer that for a bit.

@Burgestrand Burgestrand added the simmering undecided but generally optimistic label May 15, 2024
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
Development

Successfully merging this pull request may close these issues.

2 participants