Skip to content

Commit 0375657

Browse files
committed
Delete the initializer initialize_dependency_mechanism
The concept of dependencies mechanism disappears. We do not remove the attribute in AS::Dependencies itself here, that class is going to have a lot of code delete later.
1 parent 6983a89 commit 0375657

File tree

3 files changed

+6
-24
lines changed

3 files changed

+6
-24
lines changed

guides/source/configuring.md

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -274,18 +274,18 @@ Every Rails application comes with a standard set of middleware which it uses in
274274
Rails.application.config.hosts << ".product.com"
275275
```
276276
277-
You can exclude certain requests from Host Authorization checks by setting
277+
You can exclude certain requests from Host Authorization checks by setting
278278
`config.host_configuration.exclude`:
279279
280280
```ruby
281281
# Exclude requests for the /healthcheck/ path from host checking
282-
Rails.application.config.host_configuration = {
283-
exclude: ->(request) { request.path =~ /healthcheck/ }
282+
Rails.application.config.host_configuration = {
283+
exclude: ->(request) { request.path =~ /healthcheck/ }
284284
}
285-
```
285+
```
286286
287-
When a request comes to an unauthorized host, a default Rack application
288-
will run and respond with `403 Forbidden`. This can be customized by setting
287+
When a request comes to an unauthorized host, a default Rack application
288+
will run and respond with `403 Forbidden`. This can be customized by setting
289289
`config.host_configuration.response_app`. For example:
290290
291291
```ruby
@@ -1665,8 +1665,6 @@ Below is a comprehensive list of all the initializers found in Rails in the orde
16651665
16661666
* `set_clear_dependencies_hook`: This initializer - which runs only if `cache_classes` is set to `false` - uses `ActionDispatch::Callbacks.after` to remove the constants which have been referenced during the request from the object space so that they will be reloaded during the following request.
16671667
1668-
* `initialize_dependency_mechanism`: If `config.cache_classes` is true, configures `ActiveSupport::Dependencies.mechanism` to `require` dependencies rather than `load` them.
1669-
16701668
* `bootstrap_hook`: Runs all configured `before_initialize` blocks.
16711669
16721670
* `i18n.callbacks`: In the development environment, sets up a `to_prepare` callback which will call `I18n.reload!` if any of the locales have changed since the last request. In production this callback will only run on the first request.

railties/lib/rails/application/bootstrap.rb

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,6 @@ module Bootstrap
6464
end
6565
end
6666

67-
# Sets the dependency loading mechanism.
68-
initializer :initialize_dependency_mechanism, group: :all do
69-
ActiveSupport::Dependencies.mechanism = config.cache_classes ? :require : :load
70-
end
71-
7267
initializer :bootstrap_hook, group: :all do |app|
7368
ActiveSupport.run_load_hooks(:before_initialize, app)
7469
end

railties/test/application/configuration_test.rb

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -460,17 +460,6 @@ class Comment < ActiveRecord::Base
460460
end
461461
end
462462

463-
test "initialize an eager loaded, cache classes app" do
464-
add_to_config <<-RUBY
465-
config.eager_load = true
466-
config.cache_classes = true
467-
RUBY
468-
469-
app "development"
470-
471-
assert_equal :require, ActiveSupport::Dependencies.mechanism
472-
end
473-
474463
test "application is always added to eager_load namespaces" do
475464
app "development"
476465
assert_includes Rails.application.config.eager_load_namespaces, AppTemplate::Application

0 commit comments

Comments
 (0)