File tree 9 files changed +18
-36
lines changed 9 files changed +18
-36
lines changed Original file line number Diff line number Diff line change @@ -94,7 +94,6 @@ version: 2.1
94
94
command : |
95
95
COVERAGE=true PARALLEL_TEST_PROCESSORS=4 bin/parallel_rspec spec/
96
96
COVERAGE=true RSPEC_FILESYSTEM_CHANGES=true bin/rspec
97
- COVERAGE=true CLASS_RELOADING=true bin/rspec
98
97
99
98
.run_features : &run_features
100
99
run :
Original file line number Diff line number Diff line change 1
1
--format <%= ENV['CI'] ? 'documentation' : 'progress' %>
2
2
--require spec_helper
3
3
<%= "--require # {__dir__}/spec/support/simplecov_changes_env.rb --tag changes_filesystem" if ENV['RSPEC_FILESYSTEM_CHANGES'] %>
4
- <%= "--require # {__dir__}/spec/support/simplecov_reload_env.rb --tag requires_reloading" if ENV['CLASS_RELOADING'] %>
Original file line number Diff line number Diff line change 12
12
### Bug Fixes
13
13
14
14
* Fix pundit policy retrieving for static pages when the pundit namespace is : active_admin . [ #5777 ] by [ @kwent ]
15
+ * Revert [ 21b6138f] from [ #5740 ] since they actually caused the performance in development to regress. [ #5801 ] by [ @deivid-rodriguez ]
15
16
16
17
## 2.1.0 [ ☰] ( https://github.com/activeadmin/activeadmin/compare/v2.0.0..v2.1.0 )
17
18
@@ -366,6 +367,8 @@ Please check [0-6-stable] for previous changes.
366
367
[ #5043 ] : https://github.com/activeadmin/activeadmin/issues/5043
367
368
[ #5198 ] : https://github.com/activeadmin/activeadmin/issues/5198
368
369
370
+ [ 21b6138f ] : https://github.com/activeadmin/activeadmin/pull/5740/commits/21b6138fdcf58cd54c3f1d3f60cb1127b174b40f
371
+
369
372
[ #3091 ] : https://github.com/activeadmin/activeadmin/pull/3091
370
373
[ #3435 ] : https://github.com/activeadmin/activeadmin/pull/3435
371
374
[ #4477 ] : https://github.com/activeadmin/activeadmin/pull/4477
@@ -468,6 +471,7 @@ Please check [0-6-stable] for previous changes.
468
471
[ #5758 ] : https://github.com/activeadmin/activeadmin/pull/5758
469
472
[ #5777 ] : https://github.com/activeadmin/activeadmin/pull/5777
470
473
[ #5794 ] : https://github.com/activeadmin/activeadmin/pull/5794
474
+ [ #5801 ] : https://github.com/activeadmin/activeadmin/pull/5801
471
475
472
476
[ @5t111111 ] : https://github.com/5t111111
473
477
[ @aarek ] : https://github.com/aarek
Original file line number Diff line number Diff line change @@ -187,8 +187,17 @@ def remove_active_admin_load_paths_from_rails_autoload_and_eager_load
187
187
# regenerate the routes as well.
188
188
def attach_reloader
189
189
Rails . application . config . after_initialize do |app |
190
- ActiveSupport ::Reloader . after_class_unload do
191
- ActiveAdmin . application . unload!
190
+ unload_active_admin = -> { ActiveAdmin . application . unload! }
191
+
192
+ if app . config . reload_classes_only_on_change
193
+ # Rails is about to unload all the app files (e.g. models), so we
194
+ # should first unload the classes generated by Active Admin, otherwise
195
+ # they will contain references to the stale (unloaded) classes.
196
+ ActiveSupport ::Reloader . to_prepare ( prepend : true , &unload_active_admin )
197
+ else
198
+ # If the user has configured the app to always reload app files after
199
+ # each request, so we should unload the generated classes too.
200
+ ActiveSupport ::Reloader . to_complete ( &unload_active_admin )
192
201
end
193
202
194
203
admin_dirs = { }
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 3
3
RSpec . configure do |config |
4
4
config . disable_monkey_patching!
5
5
config . filter_run focus : true
6
- config . filter_run_excluding changes_filesystem : true ,
7
- requires_reloading : true
6
+ config . filter_run_excluding changes_filesystem : true
8
7
config . run_all_when_everything_filtered = true
9
8
config . color = true
10
9
config . order = :random
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 9
9
end
10
10
11
11
describe "#prepare" do
12
- before do
13
- %i[ run complete prepare class_unload ] . each do |event |
14
- ActiveSupport ::Reloader . reset_callbacks ( event )
15
- end
16
- application . prepare!
17
- end
12
+ before { application . prepare! }
18
13
19
14
it "should remove app/admin from the autoload paths" do
20
15
expect ( ActiveSupport ::Dependencies . autoload_paths ) . to_not include ( Rails . root . join ( "app/admin" ) )
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ task spec: :"spec:all"
12
12
13
13
namespace :spec do
14
14
desc "Run all specs"
15
- task all : [ :regular , :filesystem_changes , :reloading ]
15
+ task all : [ :regular , :filesystem_changes ]
16
16
17
17
desc "Run the standard specs in parallel"
18
18
task :regular do
@@ -23,11 +23,6 @@ namespace :spec do
23
23
task :filesystem_changes do
24
24
sh ( { "RSPEC_FILESYSTEM_CHANGES" => "true" } , "bin/rspec" )
25
25
end
26
-
27
- desc "Run the specs that require reloading"
28
- task :reloading do
29
- sh ( { "CLASS_RELOADING" => "true" } , "bin/rspec" )
30
- end
31
26
end
32
27
33
28
desc "Run the cucumber scenarios in parallel"
You can’t perform that action at this time.
0 commit comments