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

Rails 6.1+ Tests Won't Run: Fix References to ActiveRecord::DefineCallback #116

Open
omeedrj opened this issue Mar 23, 2021 · 3 comments
Open
Labels

Comments

@omeedrj
Copy link
Contributor

omeedrj commented Mar 23, 2021

Currently tests won't run for Rails 6 because they of this error.

master => ~/invoca/aggregate/ bundle exec appraisal rails-6 ruby test/unit/aggregate_store_test.rb
>> BUNDLE_GEMFILE=/Users/orabani/invoca/aggregate/gemfiles/rails_6.gemfile bundle exec ruby test/unit/aggregate_store_test.rb
Traceback (most recent call last):
	5: from test/unit/aggregate_store_test.rb:3:in `<main>'
	4: from test/unit/aggregate_store_test.rb:3:in `require_relative'
	3: from /Users/orabani/invoca/aggregate/test/test_helper.rb:6:in `<top (required)>'
	2: from /Users/orabani/invoca/aggregate/test/test_helper.rb:6:in `require'
	1: from /Users/orabani/invoca/aggregate/lib/aggregate.rb:6:in `<top (required)>'
/Users/orabani/invoca/aggregate/lib/aggregate.rb:6:in `require': cannot load such file -- active_record/define_callbacks (LoadError)

This is happening because the required module was removed in Rails 6.

https://github.com/rails/rails/blob/5-2-stable/activerecord/lib/active_record/define_callbacks.rb#L4-L7

Update: For now we've blocked support for Rails >= 6.1, but we'll need to address this once we get to the point where we'll want/need to support those later versions.

@omeedrj omeedrj added the bug label Mar 23, 2021
@omeedrj
Copy link
Contributor Author

omeedrj commented Mar 23, 2021

cc: @lmaragon

@ColinDKelley
Copy link
Contributor

"Fixed" for now in v2.4.0 by stopping Rails 6 support at < 6.1.

@omeedrj omeedrj changed the title Rails 6 Tests Won't Run: Fix References to ActiveRecord::DefineCallback Rails 6.1 Tests Won't Run: Fix References to ActiveRecord::DefineCallback Mar 23, 2021
@omeedrj omeedrj changed the title Rails 6.1 Tests Won't Run: Fix References to ActiveRecord::DefineCallback Rails 6.1+ Tests Won't Run: Fix References to ActiveRecord::DefineCallback Mar 23, 2021
@omeedrj
Copy link
Contributor Author

omeedrj commented Mar 23, 2021

Thanks @ColinDKelley, I updated the issue body and will leave it open as a reminder for us whenever we get to 6.1+

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

No branches or pull requests

2 participants