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

Fixes for Rails 7.1 #1252

Open
wants to merge 5 commits into
base: develop
Choose a base branch
from

Conversation

jdelStrother
Copy link
Contributor

This was going to just be a tiny fix for a LogSubscriber deprecation in Rails 7.1 (cde7554) but I ran into a few other issues getting the test-suite running.

@atomical
Copy link

@jdelStrother What errors do you get without this fix?

@jdelStrother
Copy link
Contributor Author

Fix kwarg expectations with new rspec fixes, eg,

  1) ThinkingSphinx.count passes through the given query and options
     Failure/Error:
       expect(ThinkingSphinx::Search).to receive(:new).with('foo', :bar => :baz).
         and_return(search)

     ArgumentError:
       wrong number of arguments (given 1, expected 0)
     # ./.devenv/bundle/ruby/3.1.0/gems/activesupport-7.1.0/lib/active_support/core_ext/object/with.rb:24:in `with'
     # ./spec/thinking_sphinx_spec.rb:19:in `block (3 levels) in <top (required)>'
     # ./.devenv/bundle/ruby/3.1.0/gems/rspec-retry-0.5.7/lib/rspec/retry.rb:115:in `block in run'
     # ./.devenv/bundle/ruby/3.1.0/gems/rspec-retry-0.5.7/lib/rspec/retry.rb:104:in `loop'
     # ./.devenv/bundle/ruby/3.1.0/gems/rspec-retry-0.5.7/lib/rspec/retry.rb:104:in `run'
     # ./.devenv/bundle/ruby/3.1.0/gems/rspec-retry-0.5.7/lib/rspec_ext/rspec_ext.rb:12:in `run_with_retry'
     # ./.devenv/bundle/ruby/3.1.0/gems/rspec-retry-0.5.7/lib/rspec/retry.rb:33:in `block (2 levels) in setup'

Fix FilterReflection with Rails 7.1 fixes, eg,

  5) specifying SQL for index definitions concatenates references that have column
     Failure/Error: ReflectionGenerator.new(reflection, name, class_name).call

     NoMethodError:
       undefined method `new' for nil:NilClass

           ReflectionGenerator.new(reflection, name, class_name).call
                              ^^^^
     # ./lib/thinking_sphinx/active_record/filter_reflection.rb:16:in `call'
     # ./lib/thinking_sphinx/active_record/polymorpher.rb:31:in `clone_with'
     # ./lib/thinking_sphinx/active_record/polymorpher.rb:21:in `block in append_reflections'
     # ./lib/thinking_sphinx/active_record/polymorpher.rb:18:in `each'
     # ./lib/thinking_sphinx/active_record/polymorpher.rb:18:in `append_reflections'
     # ./lib/thinking_sphinx/active_record/polymorpher.rb:9:in `morph!'
     # ./lib/thinking_sphinx/active_record/sql_source.rb:160:in `each'
     # ./lib/thinking_sphinx/active_record/sql_source.rb:160:in `prepare_for_render'
     # ./lib/thinking_sphinx/active_record/sql_source.rb:83:in `render'
     # ./.devenv/bundle/ruby/3.1.0/gems/riddle-2.4.3/lib/riddle/configuration/index.rb:30:in `block in render'
     # ./.devenv/bundle/ruby/3.1.0/gems/riddle-2.4.3/lib/riddle/configuration/index.rb:30:in `collect'
     # ./.devenv/bundle/ruby/3.1.0/gems/riddle-2.4.3/lib/riddle/configuration/index.rb:30:in `render'
     # ./lib/thinking_sphinx/core/index.rb:74:in `render'
     # ./spec/acceptance/specifying_sql_spec.rb:139:in `block (2 levels) in <top (required)>'
     # ./.devenv/bundle/ruby/3.1.0/gems/rspec-retry-0.5.7/lib/rspec/retry.rb:115:in `block in run'
     # ./.devenv/bundle/ruby/3.1.0/gems/rspec-retry-0.5.7/lib/rspec/retry.rb:104:in `loop'
     # ./.devenv/bundle/ruby/3.1.0/gems/rspec-retry-0.5.7/lib/rspec/retry.rb:104:in `run'
     # ./.devenv/bundle/ruby/3.1.0/gems/rspec-retry-0.5.7/lib/rspec_ext/rspec_ext.rb:12:in `run_with_retry'
     # ./.devenv/bundle/ruby/3.1.0/gems/rspec-retry-0.5.7/lib/rspec/retry.rb:33:in `block (2 levels) in setup'

Fix a LogSubscriber deprecation in Rails 7.1 prevents this deprecation warning:

DEPRECATION WARNING: Bolding log text with a positional boolean is deprecated and will be removed in Rails 7.2. Use an option hash instead (eg. `color("my text", :red, bold: true)`).

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.

None yet

2 participants