Sort not working on master #42

Closed
mabotelh opened this Issue May 28, 2013 · 8 comments

Projects

None yet

4 participants

Although the order is passed in, the table in the index page is not ordered.

This seems to have been created in the last commit. Undoing it though throws an ugly exception about InheritedResources::Base not being known. I'll keep digging and if I find a solution, I'll submit a pull request.

Owner
elia commented May 29, 2013

Thanks, a failing spec would also be very appreciated! :)

I will look to see if we can reuse ActiveAdmin's.

Sent from my iPhone

On May 29, 2013, at 7:52 AM, Elia Schito notifications@github.com wrote:

Thanks, a failing spec would also be very appreciated! :)


Reply to this email directly or view it on GitHub.

The issue is in ActiveAdmin::ResourceController::DataAccess#apply_sorting. I tried to monkey patch it but I keep getting the following error which I don't know how to solve.

/Users/mauro/.rvm/gems/ruby-1.9.3-p392@corndog/gems/activeadmin-0.6.0/lib/active_admin/base_controller/authorization.rb:21:in `<module:ActiveAdmin>': uninitialized constant InheritedResources::Base (NameError)
    from /Users/mauro/.rvm/gems/ruby-1.9.3-p392@corndog/gems/activeadmin-0.6.0/lib/active_admin/base_controller/authorization.rb:1:in `<top (required)>'
    from /Users/mauro/.rvm/gems/ruby-1.9.3-p392@corndog/gems/activeadmin-0.6.0/lib/active_admin/base_controller.rb:3:in `<top (required)>'
    from /Users/mauro/.rvm/gems/ruby-1.9.3-p392@corndog/gems/activeadmin-0.6.0/lib/active_admin/resource_controller/actions.rb:2:in `<module:ActiveAdmin>'
    from /Users/mauro/.rvm/gems/ruby-1.9.3-p392@corndog/gems/activeadmin-0.6.0/lib/active_admin/resource_controller/actions.rb:1:in `<top (required)>'
    from /Users/mauro/.rvm/gems/ruby-1.9.3-p392@corndog/gems/activeadmin-0.6.0/lib/active_admin/resource_controller.rb:2:in `<top (required)>'
    from /Users/mauro/Projects/activeadmin-mongoid/lib/active_admin/mongoid/data_access.rb:1:in `<top (required)>'
    from /Users/mauro/Projects/activeadmin-mongoid/lib/active_admin/mongoid.rb:11:in `<top (required)>'
    from /Users/mauro/Projects/activeadmin-mongoid/lib/activeadmin-mongoid.rb:1:in `<top (required)>'
    from /Users/mauro/.rvm/gems/ruby-1.9.3-p392@global/gems/bundler-1.2.3/lib/bundler/runtime.rb:68:in `require'
    from /Users/mauro/.rvm/gems/ruby-1.9.3-p392@global/gems/bundler-1.2.3/lib/bundler/runtime.rb:68:in `block (2 levels) in require'
    from /Users/mauro/.rvm/gems/ruby-1.9.3-p392@global/gems/bundler-1.2.3/lib/bundler/runtime.rb:66:in `each'
    from /Users/mauro/.rvm/gems/ruby-1.9.3-p392@global/gems/bundler-1.2.3/lib/bundler/runtime.rb:66:in `block in require'
    from /Users/mauro/.rvm/gems/ruby-1.9.3-p392@global/gems/bundler-1.2.3/lib/bundler/runtime.rb:55:in `each'
    from /Users/mauro/.rvm/gems/ruby-1.9.3-p392@global/gems/bundler-1.2.3/lib/bundler/runtime.rb:55:in `require'
    from /Users/mauro/.rvm/gems/ruby-1.9.3-p392@global/gems/bundler-1.2.3/lib/bundler.rb:128:in `require'
    from /Users/mauro/Projects/Corndog/config/application.rb:17:in `<top (required)>'
    from /Users/mauro/.rvm/gems/ruby-1.9.3-p392@corndog/gems/railties-3.2.12/lib/rails/commands.rb:53:in `require'
    from /Users/mauro/.rvm/gems/ruby-1.9.3-p392@corndog/gems/railties-3.2.12/lib/rails/commands.rb:53:in `block in <top (required)>'
    from /Users/mauro/.rvm/gems/ruby-1.9.3-p392@corndog/gems/railties-3.2.12/lib/rails/commands.rb:50:in `tap'
    from /Users/mauro/.rvm/gems/ruby-1.9.3-p392@corndog/gems/railties-3.2.12/lib/rails/commands.rb:50:in `<top (required)>'
    from script/rails:6:in `require'
    from script/rails:6:in `<main>'
@bartoszkopinski bartoszkopinski added a commit to bartoszkopinski/activeadmin-mongoid that referenced this issue Jul 22, 2013
@bartoszkopinski bartoszkopinski [#42] fix sorting d107567

solution works great, thanks @bartoszkopinski

@bartoszkopinski bartoszkopinski added a commit to bartoszkopinski/activeadmin-mongoid that referenced this issue Aug 19, 2013
@bartoszkopinski @bartoszkopinski bartoszkopinski + bartoszkopinski [#42] fix sorting 0df3032
Contributor

So I managed to have sorting + filtering working on my branch now but didn't have time to test it. Feel free to use the changes if needed: bartoszkopinski@elia:master...master

Owner
elia commented Aug 22, 2013

@bartoszkopinski can you send me a PR? I'll merge straight away if travis 🚥 agrees :)

@elia elia added a commit that referenced this issue Aug 22, 2013
@bartoszkopinski @elia bartoszkopinski + elia Add sorting, fixes #42
- no-collection case
- filtering for sorting
- conflict with simple_form
0ab0890
Owner
elia commented Aug 22, 2013

Closing, any discussion should move to #51

@elia elia closed this Aug 22, 2013
@elia elia referenced this issue Aug 22, 2013
Merged

Add sorting #51

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment