Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Set minimum railties version to match used methods #19

Merged
merged 1 commit into from
Apr 12, 2023

Conversation

kiskoza
Copy link
Contributor

@kiskoza kiskoza commented Aug 8, 2022

Hi. I tried to use committee-rails 0.6.1 with a Rails 5.0 application (in a CI pipeline) and it failed with an error message that lead me to writing this PR.

When I tried to figure out what the error message means, I checked the diff between 0.5.0 (which worked a month ago) and 0.6.1 and found that you're using a delegate_missing_to method in lib/committee/rails/request_object.rb, which was introduced in Rails 5.1.

I quickly checked out the repo, tried to run the test suite with Rails 5.0 and got this (similar what I'm seeing in the original CI)

An error occurred while loading ./spec/lib/methods_spec.rb.
Failure/Error: delegate_missing_to :@request

NoMethodError:
  undefined method `delegate_missing_to' for Committee::Rails::RequestObject:Class
  Did you mean?  DelegateClass
# ./lib/committee/rails/request_object.rb:5:in `<class:RequestObject>'
# ./lib/committee/rails/request_object.rb:4:in `<module:Rails>'
# ./lib/committee/rails/request_object.rb:3:in `<top (required)>'
# ./lib/committee/rails/test/methods.rb:2:in `require'
# ./lib/committee/rails/test/methods.rb:2:in `<top (required)>'
# ./lib/committee/rails.rb:2:in `require'
# ./lib/committee/rails.rb:2:in `<top (required)>'
# ./spec/spec_helper.rb:5:in `<top (required)>'

# ./spec/lib/methods_spec.rb:1:in `require'
# ./spec/lib/methods_spec.rb:1:in `<top (required)>'
# ------------------
# --- Caused by: ---
# LoadError:
#   cannot load such file -- committee-rails
#   ./spec/spec_helper.rb:5:in `<top (required)>'

As Rails 5.0 is not maintained anymore, I think the best is to drop the support here.

@kiskoza
Copy link
Contributor Author

kiskoza commented Aug 8, 2022

btw, I had issues running the tests with Rails 5.1 too, but I think it's just a missing config from the test application

@@ -21,5 +21,5 @@ Gem::Specification.new do |spec|
spec.add_dependency 'committee', '>= 4.4.0'
spec.add_dependency 'activesupport'
spec.add_dependency 'actionpack'
spec.add_dependency 'railties'
spec.add_dependency 'railties', '>= 5.1'
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought it would be more helpful to specify the version in actionpack and activesupport as well as in the railties.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've updated the PR 👍

@kiskoza kiskoza force-pushed the add-minimum-railties-constrain branch from 4f9eb4f to 6bebf19 Compare April 11, 2023 09:48
@willnet willnet merged commit d1d4fcb into willnet:main Apr 12, 2023
@willnet
Copy link
Owner

willnet commented Apr 12, 2023

thanks a lot!

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants