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

create_association in resource policy does not work with belongs_to associations, only on has_many #3266

Open
2 of 4 tasks
NowakJR opened this issue Sep 25, 2024 · 1 comment
Assignees

Comments

@NowakJR
Copy link
Contributor

NowakJR commented Sep 25, 2024

Context

def create_association?
   false
end

does not hide "create new association" button if relation is belongs_to, seems to work fine with has_many
The workaround is adding can_create: false to belongs_to field, then the button wont be visible, but it would be nice to have it all in one place

System configuration

Avo version: 3.7.4

Rails version: 7.0.8.4

Ruby version: 3.2.2

License type

  • Community
  • Pro

Are you using Avo monkey patches, overriding views or view components?

  • Yes. If so, please post code samples.
  • No
@Paul-Bob
Copy link
Contributor

Paul-Bob commented Oct 3, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

No branches or pull requests

2 participants