Jsonapi-resources: In Rails 6.1, fails on NameError: uninitialized constant ActionController::ForceSSL

Created on 10 Dec 2020  路  3Comments  路  Source: cerebris/jsonapi-resources

This issue is a (choose one):

  • [x] Problem/bug report.
  • [ ] Feature request.
  • [ ] Request for support. Note: Please try to avoid submitting issues for support requests. Use Gitter instead.

Checklist before submitting:

  • [x] I've searched for an existing issue.
  • [x] I've asked my question on Gitter and have not received a satisfactory answer.
  • [ ] I've included a complete bug report template. This step helps us and allows us to see the bug without trying to reproduce the problem from your description. It helps you because you will frequently detect if it's a problem specific to your project. NOTE: existing test suite fails on Rails 6.1
  • [x] The feature I'm asking for is compliant with the JSON:API spec.

Description

Choose one section below and delete the other:

Bug reports:

On Rails 6.1, JSONAPI::Resources fails on startup with:

NameError: uninitialized constant ActionController::ForceSSL
.../jsonapi-resources-0.10.2/lib/jsonapi/resource_controller_metal.rb:8:in `<class:ResourceControllerMetal>'

This is due to ResourceControllerMetal referencing ActionController::ForceSSL, which was deprecated in Rails 6.0 and removed in 6.1: https://guides.rubyonrails.org/upgrading_ruby_on_rails.html#force-ssl

It looked like that constant could just be removed, but I tried that and the test suite failed on something seemingly unrelated, so more may be needed to get the gem working on Rails 6.1.

    14: from /Users/josh/apps/jsonapi-resources/test/controllers/controller_test.rb:1:in `require'
    13: from /Users/josh/apps/jsonapi-resources/test/test_helper.rb:234:in `<top (required)>'
    12: from /Users/josh/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/activesupport-6.1.0/lib/active_support/dependencies.rb:332:in `require'
...
/Users/josh/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/activesupport-6.1.0/lib/active_support/core_ext/hash/keys.rb:52:in `block in assert_valid_keys': Unknown key: :source. Valid keys are: :class_name, :anonymous_class, :primary_key, :foreign_key, :dependent, :validate, :inverse_of, :strict_loading, :autosave, :before_add, :after_add, :before_remove, :after_remove, :extend, :counter_cache, :join_table, :index_errors, :ensuring_owner_was (ArgumentError)

Most helpful comment

@lgebhardt I think you can close this issue since https://github.com/cerebris/jsonapi-resources/pull/1352 is already merged.

All 3 comments

@lgebhardt I think you can close this issue since https://github.com/cerebris/jsonapi-resources/pull/1352 is already merged.

I'll close it as the reporter鈥攜es, #1346 should fix

Thanks @lgebhardt & @CodingItWrong. Awesome 馃帀

Was this page helpful?
0 / 5 - 0 ratings