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

Raising ArgumentError exception on Ransack operations #1460

Open
zokaibr opened this issue Nov 8, 2023 · 3 comments
Open

Raising ArgumentError exception on Ransack operations #1460

zokaibr opened this issue Nov 8, 2023 · 3 comments
Assignees

Comments

@zokaibr
Copy link

zokaibr commented Nov 8, 2023

Currently, when something goes wrong with some of Ransack operations of Searching and Sorting, it raises an ArgumentError exception.

There is a sample on the docs:

Article.ransack(unknown_attr_eq: 'Ernie')
# ArgumentError (Invalid search term unknown_attr_eq)

I`m proposing here to change it to a custom error specific for Ransack operations because this error is a Ruby internal one specific for missing arguments on a method call.

Besides that, Ransack users will tend to rescue this error to render a response to the end user and it may lead us to a bad error supression.

@zokaibr
Copy link
Author

zokaibr commented Nov 8, 2023

I myself would like to work on it = )

@scarroll32
Copy link
Member

Please go ahead @dfmoreto !

@zokaibr
Copy link
Author

zokaibr commented Feb 14, 2024

@scarroll32 I think it's done. I've opened the PR #1478 with the resolution = )

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

2 participants