Uysim / pagy-cursor

Cursor pagination with pagy for Ruby On Rails
MIT License
126 stars 23 forks source link

Pagy 8 support #65

Closed jasl closed 3 months ago

jasl commented 8 months ago

This PR mixed a few of things:

jasl commented 7 months ago

BTW, this branch works for my projects, but I don't know why rake spec has problem

/Users/jasl/.rbenv/versions/3.3.0/bin/ruby -I/Users/jasl/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/rspec-support-3.13.1/lib:/Users/jasl/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/rspec-core-3.13.0/lib /Users/jasl/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/rspec-core-3.13.0/exe/rspec --pattern spec/\*\*\{,/\*/\*\*\}/\*_spec.rb

An error occurred while loading spec_helper.
Failure/Error: require "rails/test_help"

NoMethodError:
  undefined method `config' for nil
# ./spec/spec_helper.rb:4:in `<top (required)>'
No examples found.

Finished in 0.00002 seconds (files took 0.63226 seconds to load)
0 examples, 0 failures, 1 error occurred outside of examples

/Users/jasl/.rbenv/versions/3.3.0/bin/ruby -I/Users/jasl/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/rspec-support-3.13.1/lib:/Users/jasl/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/rspec-core-3.13.0/lib /Users/jasl/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/rspec-core-3.13.0/exe/rspec --pattern spec/\*\*\{,/\*/\*\*\}/\*_spec.rb failed
Uysim commented 7 months ago

BTW, this branch works for my projects, but I don't know why rake spec has problem

/Users/jasl/.rbenv/versions/3.3.0/bin/ruby -I/Users/jasl/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/rspec-support-3.13.1/lib:/Users/jasl/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/rspec-core-3.13.0/lib /Users/jasl/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/rspec-core-3.13.0/exe/rspec --pattern spec/\*\*\{,/\*/\*\*\}/\*_spec.rb

An error occurred while loading spec_helper.
Failure/Error: require "rails/test_help"

NoMethodError:
  undefined method `config' for nil
# ./spec/spec_helper.rb:4:in `<top (required)>'
No examples found.

Finished in 0.00002 seconds (files took 0.63226 seconds to load)
0 examples, 0 failures, 1 error occurred outside of examples

/Users/jasl/.rbenv/versions/3.3.0/bin/ruby -I/Users/jasl/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/rspec-support-3.13.1/lib:/Users/jasl/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/rspec-core-3.13.0/lib /Users/jasl/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/rspec-core-3.13.0/exe/rspec --pattern spec/\*\*\{,/\*/\*\*\}/\*_spec.rb failed

The error is here. In gemspec we just need version. But after this change we require the whole library. Which will cause error for the first bundle. For your case, you have install dependencies since before the code break. So you will be fine.

jasl commented 7 months ago

BTW, this branch works for my projects, but I don't know why rake spec has problem

/Users/jasl/.rbenv/versions/3.3.0/bin/ruby -I/Users/jasl/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/rspec-support-3.13.1/lib:/Users/jasl/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/rspec-core-3.13.0/lib /Users/jasl/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/rspec-core-3.13.0/exe/rspec --pattern spec/\*\*\{,/\*/\*\*\}/\*_spec.rb

An error occurred while loading spec_helper.
Failure/Error: require "rails/test_help"

NoMethodError:
  undefined method `config' for nil
# ./spec/spec_helper.rb:4:in `<top (required)>'
No examples found.

Finished in 0.00002 seconds (files took 0.63226 seconds to load)
0 examples, 0 failures, 1 error occurred outside of examples

/Users/jasl/.rbenv/versions/3.3.0/bin/ruby -I/Users/jasl/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/rspec-support-3.13.1/lib:/Users/jasl/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/rspec-core-3.13.0/lib /Users/jasl/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/rspec-core-3.13.0/exe/rspec --pattern spec/\*\*\{,/\*/\*\*\}/\*_spec.rb failed

The error is here. In gemspec we just need version. But after this change we require the whole library. Which will cause error for the first bundle. For your case, you have install dependencies since before the code break. So you will be fine.

I added back version.rb, but it still got the error. My project uses Ruby 3.3 with Rails 7.1 without issues.

jasl commented 7 months ago

interesting... only Ruby 3.3 with Rails 7.1 failed