railties 8.1.3.1 → 8.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +83 -0
- data/lib/rails/application/configuration.rb +2 -2
- data/lib/rails/application/finisher.rb +1 -1
- data/lib/rails/application/routes_reloader.rb +60 -20
- data/lib/rails/application.rb +1 -5
- data/lib/rails/commands/plugin/plugin_command.rb +10 -1
- data/lib/rails/engine/lazy_route_set.rb +58 -6
- data/lib/rails/engine.rb +1 -1
- data/lib/rails/gem_version.rb +2 -2
- data/lib/rails/generators/generated_attribute.rb +17 -11
- data/lib/rails/generators/rails/db/system/change/change_generator.rb +1 -1
- data/lib/rails/paths.rb +3 -3
- data/lib/rails/templates/rails/mailers/email.html.erb +3 -3
- data/lib/rails.rb +53 -0
- metadata +11 -11
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: f244c9087e2dbf369180ece7173b2e14a38469a18adf60c5e162dfb0e9951324
|
|
4
|
+
data.tar.gz: fd0fb4cde8bd683e20f8390b82f7dcadfa596fb33d6fe81a57d3009895298517
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 5195af7a6c02302d6e1dd99586658b0b1fe866884db12852abee6c7f27b95b45af02e3ab2f2608d8d4b6119f94251e168c567bd6a4d34c3d5db107ddf7dbd644
|
|
7
|
+
data.tar.gz: 02f47c8613c4863e5d1557b2d2e4dbec321e50d72e04696f4d9fb4bdb91d3ece6e29b948db8daec8820dc60e24ce6a3e644703789f486fdf1f19f2107c4ba187
|
data/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,86 @@
|
|
|
1
|
+
## Rails 8.1.4 (September 24, 2026) ##
|
|
2
|
+
|
|
3
|
+
* Include the offending value in the `secret_key_base=` error message.
|
|
4
|
+
|
|
5
|
+
*Jean Boussier*
|
|
6
|
+
|
|
7
|
+
* Load database config when a connection is absent from the shared section.
|
|
8
|
+
|
|
9
|
+
`database_configuration` no longer raises `NoMethodError` when a shared
|
|
10
|
+
config section is missing a subsection for a particular connection name.
|
|
11
|
+
|
|
12
|
+
*Kenta Ishizaki*
|
|
13
|
+
|
|
14
|
+
* Round-trip the `null: false` attribute modifier in `GeneratedAttribute#to_s`.
|
|
15
|
+
|
|
16
|
+
`rails generate` now emits the `!` modifier for attributes with `null: false`,
|
|
17
|
+
so the generated command string can be used to regenerate the same migration.
|
|
18
|
+
|
|
19
|
+
*Kenta Ishizaki*
|
|
20
|
+
|
|
21
|
+
* Fix infinite route reload when `after_routes_loaded` hooks access routes.
|
|
22
|
+
|
|
23
|
+
The `:loading` state is now held across `after_routes_loaded` hooks, so a
|
|
24
|
+
hook that touches routes no longer triggers a redundant reload.
|
|
25
|
+
|
|
26
|
+
*Chedli Bourguiba*
|
|
27
|
+
|
|
28
|
+
* Fix `LazyRouteSet` thrashing when `url_helpers` are included into `Object`.
|
|
29
|
+
|
|
30
|
+
`method_missing` and `respond_to_missing?` now only trigger a route reload
|
|
31
|
+
for methods ending in `_path` or `_url`, preventing every `respond_to?`
|
|
32
|
+
call from re-entering the route loader.
|
|
33
|
+
|
|
34
|
+
*Chedli Bourguiba*
|
|
35
|
+
|
|
36
|
+
* Add `RoutesReloader#loaded` to check whether routes have been loaded.
|
|
37
|
+
|
|
38
|
+
*Rafael Mendonça França*
|
|
39
|
+
|
|
40
|
+
* Mark routes as loaded when the routes reloader executes standalone.
|
|
41
|
+
|
|
42
|
+
`RoutesReloader#execute` now sets the load state to `loaded`, so calling
|
|
43
|
+
it directly (outside of `execute_unless_loaded`) no longer leaves the
|
|
44
|
+
reloader in a state where routes are considered unloaded.
|
|
45
|
+
|
|
46
|
+
*Kenta Ishizaki*
|
|
47
|
+
|
|
48
|
+
* Make mounted route helpers (e.g. `main_app`, engine mount proxies) trigger
|
|
49
|
+
the lazy route load instead of raising `NoMethodError` when called before
|
|
50
|
+
routes are drawn.
|
|
51
|
+
|
|
52
|
+
Named url helpers already loaded routes on demand, but mounted helpers are
|
|
53
|
+
only defined when `mount` runs during the route draw, so calling one first
|
|
54
|
+
(in the console or a test) failed until something else drew the routes.
|
|
55
|
+
|
|
56
|
+
*Abdelkader Boudih*
|
|
57
|
+
|
|
58
|
+
* Make lazy route loading thread-safe.
|
|
59
|
+
|
|
60
|
+
Since routes are drawn on the first request in environments where
|
|
61
|
+
`config.eager_load` is `false` (development and test by default),
|
|
62
|
+
concurrent first requests could dispatch against an empty or half-drawn
|
|
63
|
+
route set, resulting in a 404 for a perfectly valid route. Route drawing
|
|
64
|
+
is now synchronized: concurrent requests wait for the initial draw to
|
|
65
|
+
complete and are then dispatched against the fully drawn route set.
|
|
66
|
+
|
|
67
|
+
*grk*
|
|
68
|
+
|
|
69
|
+
* Validate subcommand in `rails plugin` command.
|
|
70
|
+
|
|
71
|
+
`rails plugin foo bar` silently ignored the invalid subcommand "foo"
|
|
72
|
+
and proceeded to create a plugin named "bar". Now it prints an error
|
|
73
|
+
and exits with status 1.
|
|
74
|
+
|
|
75
|
+
Fixes #57430.
|
|
76
|
+
|
|
77
|
+
*Ruy Rocha*
|
|
78
|
+
|
|
79
|
+
* Prevent the internal development welcome route from being duplicated on route reloads.
|
|
80
|
+
|
|
81
|
+
*Elliot Temple*
|
|
82
|
+
|
|
83
|
+
|
|
1
84
|
## Rails 8.1.3.1 (July 29, 2026) ##
|
|
2
85
|
|
|
3
86
|
* No changes.
|
|
@@ -461,7 +461,7 @@ module Rails
|
|
|
461
461
|
if config.is_a?(Hash) && config.values.all?(Hash)
|
|
462
462
|
if shared.is_a?(Hash) && shared.values.all?(Hash)
|
|
463
463
|
config.map do |name, sub_config|
|
|
464
|
-
sub_config.reverse_merge!(shared[name])
|
|
464
|
+
sub_config.reverse_merge!(shared[name]) if shared[name]
|
|
465
465
|
end
|
|
466
466
|
else
|
|
467
467
|
config.map do |name, sub_config|
|
|
@@ -538,7 +538,7 @@ module Rails
|
|
|
538
538
|
elsif new_secret_key_base.is_a?(String) && new_secret_key_base.present?
|
|
539
539
|
@secret_key_base = new_secret_key_base
|
|
540
540
|
elsif new_secret_key_base
|
|
541
|
-
raise ArgumentError, "`secret_key_base` for #{Rails.env} environment must be a type of String`"
|
|
541
|
+
raise ArgumentError, "`secret_key_base` for #{Rails.env} environment must be a type of String, got: #{new_secret_key_base.inspect}`"
|
|
542
542
|
else
|
|
543
543
|
raise ArgumentError, "Missing `secret_key_base` for '#{Rails.env}' environment, set this string with `bin/rails credentials:edit`"
|
|
544
544
|
end
|
|
@@ -146,7 +146,7 @@ module Rails
|
|
|
146
146
|
get "/rails/info" => "rails/info#index", internal: true
|
|
147
147
|
end
|
|
148
148
|
|
|
149
|
-
routes_reloader.
|
|
149
|
+
routes_reloader.run_once_after_load_paths = -> do
|
|
150
150
|
app.routes.append do
|
|
151
151
|
get "/" => "rails/welcome#index", internal: true
|
|
152
152
|
end
|
|
@@ -1,43 +1,80 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
+
require "monitor"
|
|
3
4
|
|
|
4
5
|
module Rails
|
|
5
6
|
class Application
|
|
6
7
|
class RoutesReloader
|
|
7
8
|
include ActiveSupport::Callbacks
|
|
8
9
|
|
|
9
|
-
attr_reader :route_sets, :paths, :external_routes
|
|
10
|
+
attr_reader :route_sets, :paths, :external_routes
|
|
10
11
|
attr_accessor :eager_load
|
|
11
|
-
attr_writer :
|
|
12
|
+
attr_writer :run_once_after_load_paths # :nodoc:
|
|
12
13
|
delegate :execute_if_updated, :updated?, to: :updater
|
|
13
14
|
|
|
14
|
-
def initialize
|
|
15
|
+
def initialize(file_watcher: ActiveSupport::FileUpdateChecker)
|
|
15
16
|
@paths = []
|
|
16
17
|
@route_sets = []
|
|
17
18
|
@external_routes = []
|
|
18
19
|
@eager_load = false
|
|
19
|
-
@
|
|
20
|
+
@load_state = nil # nil (not loaded yet) | :loading | :loaded
|
|
21
|
+
@load_lock = Monitor.new
|
|
22
|
+
@file_watcher = file_watcher
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
# Returns +true+ if the routes are loaded.
|
|
26
|
+
def loaded
|
|
27
|
+
@load_state == :loaded
|
|
20
28
|
end
|
|
21
29
|
|
|
22
30
|
def reload!
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
31
|
+
@load_lock.synchronize do
|
|
32
|
+
previous_state, @load_state = @load_state, :loading
|
|
33
|
+
clear!
|
|
34
|
+
load_paths
|
|
35
|
+
finalize!
|
|
36
|
+
route_sets.each(&:eager_load!) if eager_load
|
|
37
|
+
ensure
|
|
38
|
+
@load_state = previous_state
|
|
39
|
+
revert
|
|
40
|
+
end
|
|
29
41
|
end
|
|
30
42
|
|
|
31
43
|
def execute
|
|
32
|
-
@
|
|
33
|
-
|
|
44
|
+
@load_lock.synchronize do
|
|
45
|
+
updater.execute
|
|
46
|
+
@load_state ||= :loaded
|
|
47
|
+
end
|
|
34
48
|
end
|
|
35
49
|
|
|
36
50
|
def execute_unless_loaded
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
51
|
+
return false if @load_state == :loaded
|
|
52
|
+
|
|
53
|
+
@load_lock.synchronize do
|
|
54
|
+
# Another thread finished the load while this one was blocked on
|
|
55
|
+
# @load_lock. Return true so callers like
|
|
56
|
+
# LazyRouteSet#method_missing retry the url helper that was
|
|
57
|
+
# missing when they were called.
|
|
58
|
+
return true if @load_state == :loaded
|
|
59
|
+
|
|
60
|
+
# Drawing the routes re-enters this method on the same thread —
|
|
61
|
+
# config/routes.rb itself calls routes.draw — through the
|
|
62
|
+
# reentrant Monitor; without this check the nested call would
|
|
63
|
+
# recurse into another draw.
|
|
64
|
+
return false if @load_state == :loading
|
|
65
|
+
|
|
66
|
+
# Hold :loading across after_routes_loaded as well. reload! restores
|
|
67
|
+
# the previous state when it finishes, so if we left that as nil a
|
|
68
|
+
# hook that touched routes would re-enter and draw again.
|
|
69
|
+
@load_state = :loading
|
|
70
|
+
begin
|
|
71
|
+
execute
|
|
72
|
+
ActiveSupport.run_load_hooks(:after_routes_loaded, Rails.application)
|
|
73
|
+
@load_state = :loaded
|
|
74
|
+
true
|
|
75
|
+
ensure
|
|
76
|
+
@load_state = nil if @load_state == :loading
|
|
77
|
+
end
|
|
41
78
|
end
|
|
42
79
|
end
|
|
43
80
|
|
|
@@ -48,7 +85,7 @@ module Rails
|
|
|
48
85
|
hash[dir.to_s] = %w(rb)
|
|
49
86
|
end
|
|
50
87
|
|
|
51
|
-
|
|
88
|
+
@file_watcher.new(paths, dirs) { reload! }
|
|
52
89
|
end
|
|
53
90
|
end
|
|
54
91
|
|
|
@@ -61,11 +98,14 @@ module Rails
|
|
|
61
98
|
|
|
62
99
|
def load_paths
|
|
63
100
|
paths.each { |path| load(path) }
|
|
64
|
-
|
|
101
|
+
run_after_load_paths_callback
|
|
65
102
|
end
|
|
66
103
|
|
|
67
|
-
def
|
|
68
|
-
@
|
|
104
|
+
def run_after_load_paths_callback
|
|
105
|
+
if @run_once_after_load_paths
|
|
106
|
+
@run_once_after_load_paths.call
|
|
107
|
+
@run_once_after_load_paths = nil
|
|
108
|
+
end
|
|
69
109
|
end
|
|
70
110
|
|
|
71
111
|
def finalize!
|
data/lib/rails/application.rb
CHANGED
|
@@ -156,11 +156,7 @@ module Rails
|
|
|
156
156
|
|
|
157
157
|
# Reload application routes regardless if they changed or not.
|
|
158
158
|
def reload_routes!
|
|
159
|
-
|
|
160
|
-
routes_reloader.loaded = false
|
|
161
|
-
else
|
|
162
|
-
routes_reloader.reload!
|
|
163
|
-
end
|
|
159
|
+
routes_reloader.reload!
|
|
164
160
|
end
|
|
165
161
|
|
|
166
162
|
def reload_routes_unless_loaded # :nodoc:
|
|
@@ -21,7 +21,16 @@ module Rails
|
|
|
21
21
|
class_option :no_rc, desc: "Skip evaluating .railsrc."
|
|
22
22
|
|
|
23
23
|
def perform(type = nil, *plugin_args)
|
|
24
|
-
|
|
24
|
+
if type
|
|
25
|
+
unless type == "new"
|
|
26
|
+
error "'#{type}' is not a valid plugin subcommand. Valid subcommand: new."
|
|
27
|
+
error "Run '#{self.class.executable} -h' for help."
|
|
28
|
+
exit 1
|
|
29
|
+
end
|
|
30
|
+
else
|
|
31
|
+
plugin_args << "--help"
|
|
32
|
+
end
|
|
33
|
+
|
|
25
34
|
|
|
26
35
|
unless options.key?("no_rc") # Thor's not so indifferent access hash.
|
|
27
36
|
railsrc = File.expand_path(options[:rc])
|
|
@@ -38,6 +38,39 @@ module Rails
|
|
|
38
38
|
end
|
|
39
39
|
end
|
|
40
40
|
|
|
41
|
+
# Mounted helpers are only defined when `mount` runs during the route
|
|
42
|
+
# draw. _path/_url names are left to method_missing_module, which owns
|
|
43
|
+
# them and relies on reload_routes_unless_loaded returning true only to
|
|
44
|
+
# the caller that performed the load.
|
|
45
|
+
module MountedHelpers
|
|
46
|
+
extend ActiveSupport::Concern
|
|
47
|
+
|
|
48
|
+
include ActionDispatch::Routing::RouteSet::MountedHelpers
|
|
49
|
+
|
|
50
|
+
private
|
|
51
|
+
def method_missing(method_name, ...)
|
|
52
|
+
if method_name.end_with?("_path", "_url")
|
|
53
|
+
super
|
|
54
|
+
else
|
|
55
|
+
Rails.application&.reload_routes_unless_loaded
|
|
56
|
+
if ActionDispatch::Routing::RouteSet::MountedHelpers.method_defined?(method_name)
|
|
57
|
+
public_send(method_name, ...)
|
|
58
|
+
else
|
|
59
|
+
super
|
|
60
|
+
end
|
|
61
|
+
end
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
def respond_to_missing?(method_name, include_private = false)
|
|
65
|
+
if method_name.end_with?("_path", "_url")
|
|
66
|
+
super
|
|
67
|
+
else
|
|
68
|
+
Rails.application&.reload_routes_unless_loaded
|
|
69
|
+
ActionDispatch::Routing::RouteSet::MountedHelpers.method_defined?(method_name) || super
|
|
70
|
+
end
|
|
71
|
+
end
|
|
72
|
+
end
|
|
73
|
+
|
|
41
74
|
def initialize(config = DEFAULT_CONFIG)
|
|
42
75
|
super
|
|
43
76
|
self.named_routes = NamedRouteCollection.new
|
|
@@ -85,21 +118,40 @@ module Rails
|
|
|
85
118
|
super
|
|
86
119
|
end
|
|
87
120
|
|
|
121
|
+
def mounted_helpers
|
|
122
|
+
MountedHelpers
|
|
123
|
+
end
|
|
124
|
+
|
|
125
|
+
def define_mounted_helper(name, script_namer = nil)
|
|
126
|
+
super
|
|
127
|
+
|
|
128
|
+
return if MountedHelpers.method_defined?(name)
|
|
129
|
+
|
|
130
|
+
shared = ActionDispatch::Routing::RouteSet::MountedHelpers
|
|
131
|
+
MountedHelpers.define_method("_#{name}", shared.instance_method("_#{name}"))
|
|
132
|
+
MountedHelpers.define_method(name, shared.instance_method(name))
|
|
133
|
+
end
|
|
134
|
+
|
|
88
135
|
private
|
|
89
136
|
def method_missing_module
|
|
90
137
|
@method_missing_module ||= Module.new do
|
|
91
138
|
private
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
139
|
+
# NamedRouteCollection#define_url_helper only defines "#{name}_path"
|
|
140
|
+
# and "#{name}_url" in these modules, so other suffixes can never be
|
|
141
|
+
# lazy route helpers. Without this guard, including url_helpers into
|
|
142
|
+
# Object makes every respond_to?(:to_ary) (and similar) re-enter
|
|
143
|
+
# reload_routes_unless_loaded and thrash while routes are drawing.
|
|
144
|
+
def method_missing(method_name, ...)
|
|
145
|
+
if method_name.end_with?("_path", "_url") && Rails.application&.reload_routes_unless_loaded
|
|
146
|
+
public_send(method_name, ...)
|
|
95
147
|
else
|
|
96
148
|
super
|
|
97
149
|
end
|
|
98
150
|
end
|
|
99
151
|
|
|
100
|
-
def respond_to_missing?(
|
|
101
|
-
if Rails.application&.reload_routes_unless_loaded
|
|
102
|
-
respond_to?(
|
|
152
|
+
def respond_to_missing?(method_name, include_private = false)
|
|
153
|
+
if method_name.end_with?("_path", "_url") && Rails.application&.reload_routes_unless_loaded
|
|
154
|
+
respond_to?(method_name, include_private)
|
|
103
155
|
else
|
|
104
156
|
super
|
|
105
157
|
end
|
data/lib/rails/engine.rb
CHANGED
|
@@ -307,7 +307,7 @@ module Rails
|
|
|
307
307
|
# helper MyEngine::SharedEngineHelper
|
|
308
308
|
# end
|
|
309
309
|
#
|
|
310
|
-
# If you want to include all of the engine's helpers, you can use the #
|
|
310
|
+
# If you want to include all of the engine's helpers, you can use the #helpers method on an engine's
|
|
311
311
|
# instance:
|
|
312
312
|
#
|
|
313
313
|
# class ApplicationController < ActionController::Base
|
data/lib/rails/gem_version.rb
CHANGED
|
@@ -257,17 +257,23 @@ module Rails
|
|
|
257
257
|
|
|
258
258
|
private
|
|
259
259
|
def print_attribute_options
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
260
|
+
options = attr_options.except(:null)
|
|
261
|
+
modifier = "!" if attr_options[:null] == false
|
|
262
|
+
|
|
263
|
+
body =
|
|
264
|
+
if options.empty?
|
|
265
|
+
""
|
|
266
|
+
elsif options[:size]
|
|
267
|
+
"{#{options[:size]}}"
|
|
268
|
+
elsif options[:limit]
|
|
269
|
+
"{#{options[:limit]}}"
|
|
270
|
+
elsif options[:precision] && options[:scale]
|
|
271
|
+
"{#{options[:precision]},#{options[:scale]}}"
|
|
272
|
+
else
|
|
273
|
+
"{#{options.keys.join(",")}}"
|
|
274
|
+
end
|
|
275
|
+
|
|
276
|
+
"#{body}#{modifier}"
|
|
271
277
|
end
|
|
272
278
|
end
|
|
273
279
|
end
|
|
@@ -183,7 +183,7 @@ module Rails
|
|
|
183
183
|
def devcontainer_json
|
|
184
184
|
return unless File.exist?(devcontainer_json_path)
|
|
185
185
|
|
|
186
|
-
@devcontainer_json ||= JSON.parse(File.read(devcontainer_json_path))
|
|
186
|
+
@devcontainer_json ||= JSON.parse(File.read(devcontainer_json_path), allow_comments: true)
|
|
187
187
|
end
|
|
188
188
|
|
|
189
189
|
def devcontainer_json_path
|
data/lib/rails/paths.rb
CHANGED
|
@@ -22,10 +22,10 @@ module Rails
|
|
|
22
22
|
# allows you to easily add extra paths:
|
|
23
23
|
#
|
|
24
24
|
# path.is_a?(Enumerable) # => true
|
|
25
|
-
# path.to_ary
|
|
25
|
+
# path.to_ary # => ["app/controllers"]
|
|
26
26
|
#
|
|
27
27
|
# path << "lib/controllers"
|
|
28
|
-
# path.to_ary
|
|
28
|
+
# path.to_ary # => ["app/controllers", "lib/controllers"]
|
|
29
29
|
#
|
|
30
30
|
# Notice that when you add a path using #add, the
|
|
31
31
|
# Path[rdoc-ref:Rails::Paths::Path] object created already contains the path
|
|
@@ -33,7 +33,7 @@ module Rails
|
|
|
33
33
|
# want this behavior, so you can give <tt>:with</tt> as option.
|
|
34
34
|
#
|
|
35
35
|
# root.add "config/routes", with: "config/routes.rb"
|
|
36
|
-
# root["config/routes"].
|
|
36
|
+
# root["config/routes"].to_ary # => ["config/routes.rb"]
|
|
37
37
|
#
|
|
38
38
|
# The #add method accepts the following options as arguments:
|
|
39
39
|
# +eager_load+, +autoload+, +autoload_once+, and +glob+.
|
|
@@ -117,8 +117,8 @@
|
|
|
117
117
|
<% if @email.html_part && @email.text_part %>
|
|
118
118
|
<dd>
|
|
119
119
|
<select id="part" onchange="refreshBody(false);">
|
|
120
|
-
<option
|
|
121
|
-
<option
|
|
120
|
+
<option<% if request.format == Mime[:html] %> selected<% end %> value="<%= part_query('text/html') %>">View as HTML email</option>
|
|
121
|
+
<option<% if request.format == Mime[:text] %> selected<% end %> value="<%= part_query('text/plain') %>">View as plain-text email</option>
|
|
122
122
|
</select>
|
|
123
123
|
</dd>
|
|
124
124
|
<% elsif @part %>
|
|
@@ -132,7 +132,7 @@
|
|
|
132
132
|
<dd>
|
|
133
133
|
<select id="locale" onchange="refreshBody(true);">
|
|
134
134
|
<% I18n.available_locales.each do |locale| %>
|
|
135
|
-
<option
|
|
135
|
+
<option<% if I18n.locale == locale %> selected<% end %> value="<%= locale_query(locale) %>"><%= locale %></option>
|
|
136
136
|
<% end %>
|
|
137
137
|
</select>
|
|
138
138
|
</dd>
|
data/lib/rails.rb
CHANGED
|
@@ -130,6 +130,59 @@ module Rails
|
|
|
130
130
|
application && Pathname.new(application.paths["public"].first)
|
|
131
131
|
end
|
|
132
132
|
|
|
133
|
+
# Provides access to the application autoloaders.
|
|
134
|
+
#
|
|
135
|
+
# The autoloader that manages `autoload_paths` is reachable as
|
|
136
|
+
#
|
|
137
|
+
# Rails.autoloaders.main
|
|
138
|
+
#
|
|
139
|
+
# This autoloader manages the constants that are reloaded when reloading is
|
|
140
|
+
# enabled.
|
|
141
|
+
#
|
|
142
|
+
# The autoloader that manages `autoload_once_paths` is reachable as
|
|
143
|
+
#
|
|
144
|
+
# Rails.autoloaders.once
|
|
145
|
+
#
|
|
146
|
+
# This autoloader manages constants that are autoloaded, but not reloaded.
|
|
147
|
+
#
|
|
148
|
+
# You can use these objects to customize their behavior, defining custom
|
|
149
|
+
# root namespaces, collapsing directories, configuring callbacks, etc.
|
|
150
|
+
#
|
|
151
|
+
# # config/environments/development.rb
|
|
152
|
+
# Rails.autoloaders.main.on_load("MyGateway") do
|
|
153
|
+
# MyGateway.endpoint = "https://my-gateway.localhost"
|
|
154
|
+
# end
|
|
155
|
+
#
|
|
156
|
+
# # config/environments/production.rb
|
|
157
|
+
# Rails.autoloaders.main.on_load("MyGateway") do
|
|
158
|
+
# MyGateway.endpoint = "https://my-gateway.example.com"
|
|
159
|
+
# end
|
|
160
|
+
#
|
|
161
|
+
# The +each+ iterator allows you to iterate over both loaders:
|
|
162
|
+
#
|
|
163
|
+
# Rails.autoloaders.each do |loader|
|
|
164
|
+
# loader.log!
|
|
165
|
+
# end
|
|
166
|
+
#
|
|
167
|
+
# which may be handy if you want to run the same code for both of them.
|
|
168
|
+
#
|
|
169
|
+
# Indeed, there is a shortcut for that common use case:
|
|
170
|
+
#
|
|
171
|
+
# Rails.autoloaders.log!
|
|
172
|
+
#
|
|
173
|
+
# which is handy to watch the activity of the autoloaders.
|
|
174
|
+
#
|
|
175
|
+
# Finally, +zeitwerk_enabled?+ allows you to check if autoloading is powered
|
|
176
|
+
# by Zeitwerk. This predicate returns a hard-coded true since Rails 7, but
|
|
177
|
+
# it is still in place for engines that support Rails 6.
|
|
178
|
+
#
|
|
179
|
+
# The autoloaders are available really early, you can access them in the
|
|
180
|
+
# application class body, environment configuration, initializers, etc.
|
|
181
|
+
#
|
|
182
|
+
# Please check the {Autoloading and Reloading
|
|
183
|
+
# Constants}[https://guides.rubyonrails.org/autoloading_and_reloading_constants.html]
|
|
184
|
+
# guide and the documentation of {Zeitwerk}[https://github.com/fxn/zeitwerk]
|
|
185
|
+
# itself for more details and usage patterns.
|
|
133
186
|
def autoloaders
|
|
134
187
|
application.autoloaders
|
|
135
188
|
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: railties
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 8.1.
|
|
4
|
+
version: 8.1.4
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- David Heinemeier Hansson
|
|
@@ -15,28 +15,28 @@ dependencies:
|
|
|
15
15
|
requirements:
|
|
16
16
|
- - '='
|
|
17
17
|
- !ruby/object:Gem::Version
|
|
18
|
-
version: 8.1.
|
|
18
|
+
version: 8.1.4
|
|
19
19
|
type: :runtime
|
|
20
20
|
prerelease: false
|
|
21
21
|
version_requirements: !ruby/object:Gem::Requirement
|
|
22
22
|
requirements:
|
|
23
23
|
- - '='
|
|
24
24
|
- !ruby/object:Gem::Version
|
|
25
|
-
version: 8.1.
|
|
25
|
+
version: 8.1.4
|
|
26
26
|
- !ruby/object:Gem::Dependency
|
|
27
27
|
name: actionpack
|
|
28
28
|
requirement: !ruby/object:Gem::Requirement
|
|
29
29
|
requirements:
|
|
30
30
|
- - '='
|
|
31
31
|
- !ruby/object:Gem::Version
|
|
32
|
-
version: 8.1.
|
|
32
|
+
version: 8.1.4
|
|
33
33
|
type: :runtime
|
|
34
34
|
prerelease: false
|
|
35
35
|
version_requirements: !ruby/object:Gem::Requirement
|
|
36
36
|
requirements:
|
|
37
37
|
- - '='
|
|
38
38
|
- !ruby/object:Gem::Version
|
|
39
|
-
version: 8.1.
|
|
39
|
+
version: 8.1.4
|
|
40
40
|
- !ruby/object:Gem::Dependency
|
|
41
41
|
name: rackup
|
|
42
42
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -133,14 +133,14 @@ dependencies:
|
|
|
133
133
|
requirements:
|
|
134
134
|
- - '='
|
|
135
135
|
- !ruby/object:Gem::Version
|
|
136
|
-
version: 8.1.
|
|
136
|
+
version: 8.1.4
|
|
137
137
|
type: :development
|
|
138
138
|
prerelease: false
|
|
139
139
|
version_requirements: !ruby/object:Gem::Requirement
|
|
140
140
|
requirements:
|
|
141
141
|
- - '='
|
|
142
142
|
- !ruby/object:Gem::Version
|
|
143
|
-
version: 8.1.
|
|
143
|
+
version: 8.1.4
|
|
144
144
|
description: 'Rails internals: application bootup, plugins, generators, and rake tasks.'
|
|
145
145
|
email: david@loudthinking.com
|
|
146
146
|
executables:
|
|
@@ -509,10 +509,10 @@ licenses:
|
|
|
509
509
|
- MIT
|
|
510
510
|
metadata:
|
|
511
511
|
bug_tracker_uri: https://github.com/rails/rails/issues
|
|
512
|
-
changelog_uri: https://github.com/rails/rails/blob/v8.1.
|
|
513
|
-
documentation_uri: https://api.rubyonrails.org/v8.1.
|
|
512
|
+
changelog_uri: https://github.com/rails/rails/blob/v8.1.4/railties/CHANGELOG.md
|
|
513
|
+
documentation_uri: https://api.rubyonrails.org/v8.1.4/
|
|
514
514
|
mailing_list_uri: https://discuss.rubyonrails.org/c/rubyonrails-talk
|
|
515
|
-
source_code_uri: https://github.com/rails/rails/tree/v8.1.
|
|
515
|
+
source_code_uri: https://github.com/rails/rails/tree/v8.1.4/railties
|
|
516
516
|
rubygems_mfa_required: 'true'
|
|
517
517
|
rdoc_options:
|
|
518
518
|
- "--exclude"
|
|
@@ -530,7 +530,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
530
530
|
- !ruby/object:Gem::Version
|
|
531
531
|
version: '0'
|
|
532
532
|
requirements: []
|
|
533
|
-
rubygems_version: 4.0.
|
|
533
|
+
rubygems_version: 4.0.20
|
|
534
534
|
specification_version: 4
|
|
535
535
|
summary: Tools for creating, working with, and running Rails applications.
|
|
536
536
|
test_files: []
|