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

Mongoid 7 support #150

Merged
merged 8 commits into from
Jan 29, 2020
Merged

Mongoid 7 support #150

merged 8 commits into from
Jan 29, 2020

Conversation

grzegorz-jakubiak
Copy link
Collaborator

Addresses #142

@grzegorz-jakubiak
Copy link
Collaborator Author

@deivid-rodriguez do you have any idea how to fix this issue?

NameError:
  uninitialized constant Responders::FlashResponder::ActionView
# ./vendor/bundle/ruby/2.4.0/gems/responders-2.4.1/lib/responders/flash_responder.rb:93:in `<module:FlashResponder>'
# ./vendor/bundle/ruby/2.4.0/gems/responders-2.4.1/lib/responders/flash_responder.rb:85:in `<module:Responders>'
# ./vendor/bundle/ruby/2.4.0/gems/responders-2.4.1/lib/responders/flash_responder.rb:1:in `<top (required)>'
# ./vendor/bundle/ruby/2.4.0/gems/inherited_resources-1.11.0/lib/inherited_resources/responder.rb:3:in `require'
# ./vendor/bundle/ruby/2.4.0/gems/inherited_resources-1.11.0/lib/inherited_resources/responder.rb:3:in `<class:Responder>'
# ./vendor/bundle/ruby/2.4.0/gems/inherited_resources-1.11.0/lib/inherited_resources/responder.rb:2:in `<module:InheritedResources>'
# ./vendor/bundle/ruby/2.4.0/gems/inherited_resources-1.11.0/lib/inherited_resources/responder.rb:1:in `<top (required)>'
# ./vendor/bundle/ruby/2.4.0/gems/inherited_resources-1.11.0/lib/inherited_resources.rb:6:in `require'
# ./vendor/bundle/ruby/2.4.0/gems/inherited_resources-1.11.0/lib/inherited_resources.rb:6:in `<top (required)>'
# ./vendor/bundle/ruby/2.4.0/gems/activeadmin-2.6.0/lib/active_admin.rb:9:in `require'
# ./vendor/bundle/ruby/2.4.0/gems/activeadmin-2.6.0/lib/active_admin.rb:9:in `<top (required)>'
# ./lib/active_admin/mongoid.rb:6:in `require'
# ./lib/active_admin/mongoid.rb:6:in `<top (required)>'
# ./lib/activeadmin-mongoid.rb:1:in `require'
# ./lib/activeadmin-mongoid.rb:1:in `<top (required)>'
# /home/travis/.rvm/gems/ruby-2.4.6/gems/bundler-2.1.4/lib/bundler.rb:174:in `require'
# ./spec/spec_helper.rb:14:in `<top (required)>'
# ./spec/features/smoke_spec.rb:2:in `require'
# ./spec/features/smoke_spec.rb:2:in `<top (required)>'

I only noticed that acitveadmin has changed its dependency on inherited_resources to a newer version but I don't know the implications of that.

@deivid-rodriguez
Copy link
Member

deivid-rodriguez commented Jan 27, 2020

The error means that action_view has not been yet required at that point. It sounds to me that it's the responders gem that should be explicitly depending on and requiring action_view, but I guess you can workaround the problem by explicitly requiring it from activeadmin-mongoid's test suite.

But honestly, I would actually remove the Bundler.require call that's failing in spec/spec_helper.rb:14, since I don't think it's required (if you run your test suite through bundler, I think the bundle shoud've been already setup and required at that point).

@grzegorz-jakubiak
Copy link
Collaborator Author

Thanks for the suggestion but the error must be somewhere else, unfortunately, cause removing the line didn't help and the issue persists.

@deivid-rodriguez
Copy link
Member

deivid-rodriguez commented Jan 27, 2020

Yeah, I figured that would simply move the error to somewhere else. Now try adding require "action_view/railtie" to test_app/config/application.rb. It will most likely fix the error. Still, we should probably report the missing dependency to responders anyways.

@grzegorz-jakubiak
Copy link
Collaborator Author

didn't work 😢 we should definitely report it

@deivid-rodriguez
Copy link
Member

Oh, but you haven't removed the Bundler.require where the error is happening, can you try that?

@grzegorz-jakubiak grzegorz-jakubiak force-pushed the feature/mongoid-7 branch 6 times, most recently from fc098ef to ddd7549 Compare January 27, 2020 23:54
@grzegorz-jakubiak
Copy link
Collaborator Author

@deivid-rodriguez I fixed all the issues and pushed test fixes on to master and rebased this branch. When working on fixing mongoid issues I had a look at mongoid docs, railsadminteam/rails_admin@9ef623f and SechinAndrey@0fb31c9. Please have a second look at this PR. 😄

@grzegorz-jakubiak
Copy link
Collaborator Author

@boie0025 have a look as well

@deivid-rodriguez
Copy link
Member

@grzegorz-jakubiak I'm sorry I'm not able to find time to review the specific mongoid fixes right now. But you got CI passing so that's a very good sign.

@MiguelSavignano
Copy link

MiguelSavignano commented Jan 28, 2020

Hi @grzegorz-jakubiak
I installed activeadmin-mongoid using this branch and evething it's ok on Rails 6 with mongoid (7.0.5).

@grzegorz-jakubiak grzegorz-jakubiak merged commit 119d9fc into master Jan 29, 2020
@grzegorz-jakubiak grzegorz-jakubiak deleted the feature/mongoid-7 branch January 29, 2020 15:02
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

Successfully merging this pull request may close these issues.

3 participants