Skip to content
This repository has been archived by the owner on Mar 30, 2022. It is now read-only.

Sorting not working - undefined method visit_Ransack_Nodes_Sort #2

Open
wurmrobert opened this issue Apr 17, 2019 · 2 comments · May be fixed by #7
Open

Sorting not working - undefined method visit_Ransack_Nodes_Sort #2

wurmrobert opened this issue Apr 17, 2019 · 2 comments · May be fixed by #7

Comments

@wurmrobert
Copy link

Searching works as expected but i get an exception when i do sorting. Visitor can´t find the method visit_Ransack_Nodes_Sort.

@search = object_class.ransack(query)
@search.sorts = "any_attribute asc"

The exception:

2019-04-17 13:19:30.438583 I [19:puma 001] (44.5ms) DeviceViewDocsisController -- Completed #index -- {:controller=>"DeviceViewDocsisController", :action=>"index", :params=>{"page"=>{"number"=>"1", "size"=>"12"}, "sort"=>"-downstream_snr_min", "device_view_docsi"=>{}}, :format=>"HTML", :method=>"GET", :path=>"/api/v1/device_view_docsis", :view_runtime=>0.0, :db_runtime=>0.0, :exception_object=>#<NoMethodError: undefined method `visit_Ransack_Nodes_Sort' for #<Ransack::Visitor:0x00007f6ae8ee14c0>
Did you mean?  visit_Ransack_Nodes_Grouping>, :status=>500, :status_message=>"Internal Server Error"}
2019-04-17 13:19:30.439024 D [19:puma 001] Rails -- undefined method `visit_Ransack_Nodes_Sort' for #<Ransack::Visitor:0x00007f6ae8ee14c0>
Did you mean?  visit_Ransack_Nodes_Grouping excluded from capture: DSN not set
2019-04-17 13:19:30.439086 F [19:puma 001 debug_exceptions.rb:9] Rails -- Exception: NoMethodError: undefined method `visit_Ransack_Nodes_Sort' for #<Ransack::Visitor:0x00007f6ae8ee14c0>
Did you mean?  visit_Ransack_Nodes_Grouping
/usr/local/bundle/bundler/gems/ransack-99d01571f204/lib/ransack/visitor.rb:42:in `visit'
/usr/local/bundle/bundler/gems/ransack-99d01571f204/lib/ransack/visitor.rb:5:in `accept'
/usr/local/bundle/bundler/gems/ransack-99d01571f204/lib/ransack/visitor.rb:13:in `block in visit_Array'
/usr/local/bundle/bundler/gems/ransack-99d01571f204/lib/ransack/visitor.rb:13:in `map'
/usr/local/bundle/bundler/gems/ransack-99d01571f204/lib/ransack/visitor.rb:13:in `visit_Array'
/usr/local/bundle/bundler/gems/ransack-99d01571f204/lib/ransack/visitor.rb:42:in `visit'
/usr/local/bundle/bundler/gems/ransack-99d01571f204/lib/ransack/visitor.rb:5:in `accept'
/usr/local/bundle/bundler/gems/ransack-mongoid-bd1935293d2f/lib/ransack/adapters/mongoid/context.rb:46:in `evaluate'
/usr/local/bundle/bundler/gems/ransack-99d01571f204/lib/ransack/search.rb:36:in `result'
/var/www/easyprovisioning_monitoring/app/controllers/device_view_docsis_controller.rb:106:in `custom_sorting'
/var/www/easyprovisioning_monitoring/app/controllers/device_view_docsis_controller.rb:56:in `query_model'
/var/www/easyprovisioning_monitoring/app/controllers/device_view_docsis_controller.rb:12:in `index'
@23tux
Copy link

23tux commented Jul 2, 2020

@wurmrobert did you ever find a solution to this?

@Ruxton Ruxton linked a pull request Jul 3, 2020 that will close this issue
@Ruxton
Copy link

Ruxton commented Jul 3, 2020

@23tux see #7

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

Successfully merging a pull request may close this issue.

3 participants