Skip to content

Commit

Permalink
Fix: classic autoloader is dropped in Rails 7
Browse files Browse the repository at this point in the history
  • Loading branch information
khiav reoy committed Sep 9, 2024
1 parent 13dcef7 commit f7825dc
Show file tree
Hide file tree
Showing 9 changed files with 12 additions and 2 deletions.
1 change: 1 addition & 0 deletions atomically.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ Gem::Specification.new do |spec|
spec.add_development_dependency 'pg', '~> 0.18'
spec.add_development_dependency 'pluck_all', '>= 2.0.3'
spec.add_development_dependency 'timecop', '~> 0.9.1'
spec.add_development_dependency 'rails_compatibility', '>= 0.0.8'

spec.add_dependency 'activerecord', '>= 3'
spec.add_dependency 'activerecord-import', '>= 0.27.0'
Expand Down
1 change: 1 addition & 0 deletions gemfiles/3.2.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ group :test do
gem 'pluck_all', '>= 2.0.3'
gem 'timecop', '~> 0.9.1'
gem 'update_all_scope', '~> 0.1.0'
gem 'rails_compatibility', '>= 0.0.8'
end

gemspec path: '../'
1 change: 1 addition & 0 deletions gemfiles/4.2.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ group :test do
gem 'pluck_all', '>= 2.0.3'
gem 'timecop', '~> 0.9.1'
gem 'update_all_scope', '~> 0.1.0'
gem 'rails_compatibility', '>= 0.0.8'
end

gemspec path: '../'
1 change: 1 addition & 0 deletions gemfiles/5.0.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ group :test do
gem 'pluck_all', '>= 2.0.3'
gem 'timecop', '~> 0.9.1'
gem 'update_all_scope', '~> 0.1.0'
gem 'rails_compatibility', '>= 0.0.8'
end

gemspec path: '../'
1 change: 1 addition & 0 deletions gemfiles/5.1.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ group :test do
gem 'pluck_all', '>= 2.0.3'
gem 'timecop', '~> 0.9.1'
gem 'update_all_scope', '~> 0.1.0'
gem 'rails_compatibility', '>= 0.0.8'
end

gemspec path: '../'
1 change: 1 addition & 0 deletions gemfiles/5.2.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ group :test do
gem 'pluck_all', '>= 2.0.3'
gem 'timecop', '~> 0.9.1'
gem 'update_all_scope', '~> 0.1.0'
gem 'rails_compatibility', '>= 0.0.8'
end

gemspec path: '../'
1 change: 1 addition & 0 deletions gemfiles/6.0.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ group :test do
gem 'pluck_all', '>= 2.0.4'
gem 'timecop', '~> 0.9.1'
gem 'update_all_scope', '~> 0.1.0'
gem 'rails_compatibility', '>= 0.0.8'
end

gemspec path: '../'
2 changes: 2 additions & 0 deletions gemfiles/7.2.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ group :test do
gem 'pluck_all', '>= 2.0.4'
gem 'timecop', '~> 0.9.1'
gem 'update_all_scope', '~> 0.1.0'
gem 'rails_compatibility', '>= 0.0.8'
gem 'zeitwerk', '~> 2.6.18'
end

gemspec path: '../'
5 changes: 3 additions & 2 deletions test/lib/seeds.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# frozen_string_literal: true

require 'rails_compatibility/setup_autoload_paths'
RailsCompatibility.setup_autoload_paths [File.expand_path('../models/', __FILE__)]

ActiveRecord::Schema.define do
self.verbose = false

Expand Down Expand Up @@ -27,8 +30,6 @@
end
end

ActiveSupport::Dependencies.autoload_paths << File.expand_path('../models/', __FILE__)

users = User.create([
{ name: 'user_with_bomb_and_water_gun', money: 100, action_point: 3 },
{ name: 'user_with_bomb', money: 200, action_point: 0 },
Expand Down

0 comments on commit f7825dc

Please sign in to comment.