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

Undefined method `to_sym' when calling search.sorts.empty? Under 4.2.0 #1504

Open
mlabarca opened this issue Jul 11, 2024 · 0 comments
Open

Comments

@mlabarca
Copy link

We upgraded to this version recently and we started getting these errors, had to do a rollback. Seems like context.rb used to work with a nil string here and now it doesn't?

gems/ransack-4.2.0/lib/ransack/context.rb:155:in `ransackable_alias': undefined method `to_sym' for nil (NoMethodError) 	 
gems/ransack-4.2.0/lib/ransack/nodes/sort.rb:34:in `name=' 	
gems/ransack-4.2.0/lib/ransack/nodes/sort.rb:20:in `block in build' 	
gems/ransack-4.2.0/lib/ransack/nodes/sort.rb:18:in `each' 	
gems/ransack-4.2.0/lib/ransack/nodes/sort.rb:18:in `build' 
gems/ransack-4.2.0/lib/ransack/nodes/sort.rb:13:in `extract' 
gems/ransack-4.2.0/lib/ransack/search.rb:69:in `block in sorts=' 
gems/ransack-4.2.0/lib/ransack/search.rb:65:in `each' 	
gems/ransack-4.2.0/lib/ransack/search.rb:65:in `sorts=' 	
gems/ransack-4.2.0/lib/ransack/search.rb:79:in `sorts=' 	

These happen when calling sorts = on a search instance with nothing I believe.

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