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

Ignore validations for admin user #3154

Open
anklos opened this issue Jun 13, 2019 · 0 comments
Open

Ignore validations for admin user #3154

anklos opened this issue Jun 13, 2019 · 0 comments

Comments

@anklos
Copy link

anklos commented Jun 13, 2019

Background

I want to ignore some model validations validations for admin user.

Solutions:

  1. I tried https://github.com/stephskardal/rails_admin_import gem where you can assign an attribute in the import hooks: https://github.com/stephskardal/rails_admin_import#import-hooks. However in my Rails 5 the before_import_save cannot be triggered at all when an object gets updated.

  2. I am thinking to use Thread.current to store the user object in controller, then use it in model. But I don't know how i can get the user in the rails_admin. For example, I have a bids controller /bids. Since the admin panel uses another one /admin/panels, so i cannot set a before_action in my bids controller to get current user.

Any suggestion please? Thanks a lot!

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

No branches or pull requests

1 participant