railties 7.2.0.beta2 → 7.2.0.rc1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +13 -0
- data/lib/rails/api/task.rb +3 -2
- data/lib/rails/application/configuration.rb +39 -1
- data/lib/rails/application.rb +9 -39
- data/lib/rails/commands/boot/boot_command.rb +14 -0
- data/lib/rails/commands/devcontainer/devcontainer_command.rb +6 -1
- data/lib/rails/commands/test/test_command.rb +1 -1
- data/lib/rails/console/methods.rb +1 -1
- data/lib/rails/gem_version.rb +1 -1
- data/lib/rails/generators/rails/app/app_generator.rb +1 -1
- data/lib/rails/generators/rails/app/templates/Dockerfile.tt +2 -2
- data/lib/rails/generators/rails/app/templates/bin/setup.tt +1 -1
- data/lib/rails/generators/rails/app/templates/config/environments/development.rb.tt +3 -1
- data/lib/rails/generators/rails/app/templates/config/environments/production.rb.tt +3 -0
- data/lib/rails/generators/rails/app/templates/config/environments/test.rb.tt +2 -0
- data/lib/rails/generators/rails/app/templates/github/ci.yml.tt +1 -1
- data/lib/rails/generators/rails/devcontainer/devcontainer_generator.rb +1 -1
- data/lib/rails/generators/rails/devcontainer/templates/devcontainer/compose.yaml.tt +0 -9
- data/lib/rails/generators/rails/plugin/templates/app/views/layouts/%namespaced_name%/application.html.erb.tt +2 -0
- data/lib/rails/generators/rails/plugin/templates/github/ci.yml.tt +1 -1
- data/lib/rails/generators/test_unit/mailer/templates/functional_test.rb.tt +6 -4
- data/lib/rails/generators/test_unit/mailer/templates/preview.rb.tt +3 -2
- data/lib/rails/generators/test_unit/scaffold/scaffold_generator.rb +5 -1
- data/lib/rails/generators/test_unit/scaffold/templates/api_functional_test.rb.tt +2 -2
- data/lib/rails/generators/test_unit/scaffold/templates/functional_test.rb.tt +2 -2
- data/lib/rails/templates/rails/welcome/index.html.erb +1 -0
- data/lib/rails/test_unit/runner.rb +11 -6
- metadata +15 -14
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cb9a6fb87cba868a449d51a15e1e5af1db4e7e24ae38785e87864fb8af02013f
|
4
|
+
data.tar.gz: 4e0738ed982464f2ee14857de6459c240ef5b2da95013edbfb72c9e46336b638
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3cc681949d72b7535f4114a5473e2f4dc15bee814f8ae6f294ac99a1216ff5287ddae10de169b83be35d27b8cd318cc5773b461d3c626fb383546f51deaefed3
|
7
|
+
data.tar.gz: f8cfc51cc0232b3b2355cc54934682401d89ff16bee994976b7262e31b52d034a9caf00e088ccfcbe05ec69cce6af874c5b73dde9a837cb1d2f552e101c7db94
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,16 @@
|
|
1
|
+
## Rails 7.2.0.rc1 (August 06, 2024) ##
|
2
|
+
|
3
|
+
* The new `bin/rails boot` command boots the application and exits. Supports the
|
4
|
+
standard `-e/--environment` options.
|
5
|
+
|
6
|
+
*Xavier Noria*
|
7
|
+
|
8
|
+
|
9
|
+
## Rails 7.2.0.beta3 (July 11, 2024) ##
|
10
|
+
|
11
|
+
* No changes.
|
12
|
+
|
13
|
+
|
1
14
|
## Rails 7.2.0.beta2 (June 04, 2024) ##
|
2
15
|
|
3
16
|
* No changes.
|
data/lib/rails/api/task.rb
CHANGED
@@ -160,8 +160,9 @@ module Rails
|
|
160
160
|
|
161
161
|
# Only generate documentation for files that have been
|
162
162
|
# changed since the API was generated.
|
163
|
-
|
164
|
-
|
163
|
+
timestamp_path = "#{api_dir}/created.rid"
|
164
|
+
if File.exist?(timestamp_path) && !File.zero?(timestamp_path) && !ENV["ALL"]
|
165
|
+
last_generation = DateTime.rfc2822(File.open(timestamp_path, &:readline))
|
165
166
|
|
166
167
|
rdoc_files.keep_if do |file|
|
167
168
|
File.mtime(file).to_datetime > last_generation
|
@@ -15,7 +15,7 @@ module Rails
|
|
15
15
|
:cache_classes, :cache_store, :consider_all_requests_local, :console,
|
16
16
|
:eager_load, :exceptions_app, :file_watcher, :filter_parameters, :precompile_filter_parameters,
|
17
17
|
:force_ssl, :helpers_paths, :hosts, :host_authorization, :logger, :log_formatter,
|
18
|
-
:log_tags, :railties_order, :relative_url_root,
|
18
|
+
:log_tags, :railties_order, :relative_url_root,
|
19
19
|
:ssl_options, :public_file_server,
|
20
20
|
:session_options, :time_zone, :reload_classes_only_on_change,
|
21
21
|
:beginning_of_week, :filter_redirect, :x,
|
@@ -498,6 +498,28 @@ module Rails
|
|
498
498
|
generators.colorize_logging = val
|
499
499
|
end
|
500
500
|
|
501
|
+
def secret_key_base
|
502
|
+
@secret_key_base || begin
|
503
|
+
self.secret_key_base = if generate_local_secret?
|
504
|
+
generate_local_secret
|
505
|
+
else
|
506
|
+
ENV["SECRET_KEY_BASE"] || Rails.application.credentials.secret_key_base
|
507
|
+
end
|
508
|
+
end
|
509
|
+
end
|
510
|
+
|
511
|
+
def secret_key_base=(new_secret_key_base)
|
512
|
+
if new_secret_key_base.nil? && generate_local_secret?
|
513
|
+
@secret_key_base = generate_local_secret
|
514
|
+
elsif new_secret_key_base.is_a?(String) && new_secret_key_base.present?
|
515
|
+
@secret_key_base = new_secret_key_base
|
516
|
+
elsif new_secret_key_base
|
517
|
+
raise ArgumentError, "`secret_key_base` for #{Rails.env} environment must be a type of String`"
|
518
|
+
else
|
519
|
+
raise ArgumentError, "Missing `secret_key_base` for '#{Rails.env}' environment, set this string with `bin/rails credentials:edit`"
|
520
|
+
end
|
521
|
+
end
|
522
|
+
|
501
523
|
# Specifies what class to use to store the session. Possible values
|
502
524
|
# are +:cache_store+, +:cookie_store+, +:mem_cache_store+, a custom
|
503
525
|
# store, or +:disabled+. +:disabled+ tells \Rails not to deal with
|
@@ -603,6 +625,22 @@ module Rails
|
|
603
625
|
|
604
626
|
{ content_path: content_path, key_path: key_path }
|
605
627
|
end
|
628
|
+
|
629
|
+
def generate_local_secret
|
630
|
+
key_file = root.join("tmp/local_secret.txt")
|
631
|
+
|
632
|
+
unless File.exist?(key_file)
|
633
|
+
random_key = SecureRandom.hex(64)
|
634
|
+
FileUtils.mkdir_p(key_file.dirname)
|
635
|
+
File.binwrite(key_file, random_key)
|
636
|
+
end
|
637
|
+
|
638
|
+
File.binread(key_file)
|
639
|
+
end
|
640
|
+
|
641
|
+
def generate_local_secret?
|
642
|
+
Rails.env.local? || ENV["SECRET_KEY_BASE_DUMMY"]
|
643
|
+
end
|
606
644
|
end
|
607
645
|
end
|
608
646
|
end
|
data/lib/rails/application.rb
CHANGED
@@ -207,17 +207,20 @@ module Rails
|
|
207
207
|
# It is recommended not to use the same verifier for different things, so you can get different
|
208
208
|
# verifiers passing the +verifier_name+ argument.
|
209
209
|
#
|
210
|
+
# For instance, +ActiveStorage::Blob.signed_id_verifier+ is implemented using this feature, which assures that
|
211
|
+
# the IDs strings haven't been tampered with and are safe to use in a finder.
|
212
|
+
#
|
213
|
+
# See the ActiveSupport::MessageVerifier documentation for more information.
|
214
|
+
#
|
210
215
|
# ==== Parameters
|
211
216
|
#
|
212
217
|
# * +verifier_name+ - the name of the message verifier.
|
213
218
|
#
|
214
219
|
# ==== Examples
|
215
220
|
#
|
216
|
-
# message = Rails.application.message_verifier('
|
217
|
-
# Rails.application.message_verifier('
|
218
|
-
# # => '
|
219
|
-
#
|
220
|
-
# See the ActiveSupport::MessageVerifier documentation for more information.
|
221
|
+
# message = Rails.application.message_verifier('my_purpose').generate('data to sign against tampering')
|
222
|
+
# Rails.application.message_verifier('my_purpose').verify(message)
|
223
|
+
# # => 'data to sign against tampering'
|
221
224
|
def message_verifier(verifier_name)
|
222
225
|
message_verifiers[verifier_name]
|
223
226
|
end
|
@@ -457,13 +460,7 @@ module Rails
|
|
457
460
|
# then +credentials.secret_key_base+. For most applications, the correct place to store it is in the
|
458
461
|
# encrypted credentials file.
|
459
462
|
def secret_key_base
|
460
|
-
|
461
|
-
config.secret_key_base ||= generate_local_secret
|
462
|
-
else
|
463
|
-
validate_secret_key_base(
|
464
|
-
ENV["SECRET_KEY_BASE"] || credentials.secret_key_base
|
465
|
-
)
|
466
|
-
end
|
463
|
+
config.secret_key_base
|
467
464
|
end
|
468
465
|
|
469
466
|
# Returns an ActiveSupport::EncryptedConfiguration instance for the
|
@@ -616,39 +613,12 @@ module Rails
|
|
616
613
|
default_stack.build_stack
|
617
614
|
end
|
618
615
|
|
619
|
-
def validate_secret_key_base(secret_key_base)
|
620
|
-
if secret_key_base.is_a?(String) && secret_key_base.present?
|
621
|
-
secret_key_base
|
622
|
-
elsif secret_key_base
|
623
|
-
raise ArgumentError, "`secret_key_base` for #{Rails.env} environment must be a type of String`"
|
624
|
-
else
|
625
|
-
raise ArgumentError, "Missing `secret_key_base` for '#{Rails.env}' environment, set this string with `bin/rails credentials:edit`"
|
626
|
-
end
|
627
|
-
end
|
628
|
-
|
629
616
|
def ensure_generator_templates_added
|
630
617
|
configured_paths = config.generators.templates
|
631
618
|
configured_paths.unshift(*(paths["lib/templates"].existent - configured_paths))
|
632
619
|
end
|
633
620
|
|
634
621
|
private
|
635
|
-
def generate_local_secret
|
636
|
-
if config.secret_key_base.nil?
|
637
|
-
key_file = Rails.root.join("tmp/local_secret.txt")
|
638
|
-
|
639
|
-
if File.exist?(key_file)
|
640
|
-
config.secret_key_base = File.binread(key_file)
|
641
|
-
else
|
642
|
-
random_key = SecureRandom.hex(64)
|
643
|
-
FileUtils.mkdir_p(key_file.dirname)
|
644
|
-
File.binwrite(key_file, random_key)
|
645
|
-
config.secret_key_base = File.binread(key_file)
|
646
|
-
end
|
647
|
-
end
|
648
|
-
|
649
|
-
config.secret_key_base
|
650
|
-
end
|
651
|
-
|
652
622
|
def build_request(env)
|
653
623
|
req = super
|
654
624
|
env["ORIGINAL_FULLPATH"] = req.fullpath
|
@@ -0,0 +1,14 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "rails/command/environment_argument"
|
4
|
+
|
5
|
+
module Rails
|
6
|
+
module Command
|
7
|
+
class BootCommand < Base # :nodoc:
|
8
|
+
include EnvironmentArgument
|
9
|
+
|
10
|
+
desc "boot", "Boot the application and exit"
|
11
|
+
def perform(*) = boot_application!
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
@@ -22,13 +22,18 @@ module Rails
|
|
22
22
|
def devcontainer_options
|
23
23
|
@devcontainer_options ||= {
|
24
24
|
app_name: Rails.application.railtie_name.chomp("_application"),
|
25
|
-
database: !!defined?(ActiveRecord) &&
|
25
|
+
database: !!defined?(ActiveRecord) && database,
|
26
26
|
active_storage: !!defined?(ActiveStorage),
|
27
27
|
redis: !!(defined?(ActionCable) || defined?(ActiveJob)),
|
28
28
|
system_test: File.exist?("test/application_system_test_case.rb"),
|
29
29
|
node: File.exist?(".node-version"),
|
30
30
|
}
|
31
31
|
end
|
32
|
+
|
33
|
+
def database
|
34
|
+
adapter = ActiveRecord::Base.connection_db_config.adapter
|
35
|
+
adapter == "mysql2" ? "mysql" : adapter
|
36
|
+
end
|
32
37
|
end
|
33
38
|
end
|
34
39
|
end
|
@@ -32,7 +32,7 @@ module Rails
|
|
32
32
|
run_prepare_task if self.args.none?(EXACT_TEST_ARGUMENT_PATTERN)
|
33
33
|
Rails::TestUnit::Runner.run(args)
|
34
34
|
rescue Rails::TestUnit::InvalidTestError => error
|
35
|
-
|
35
|
+
raise ArgumentError, error.message
|
36
36
|
end
|
37
37
|
|
38
38
|
# Define Thor tasks to avoid going through Rake and booting twice when using bin/rails test:*
|
@@ -13,7 +13,7 @@ module Rails
|
|
13
13
|
end
|
14
14
|
|
15
15
|
def self.raise_deprecation_warning
|
16
|
-
Rails.deprecator.warn(<<~MSG, caller_locations(
|
16
|
+
Rails.deprecator.warn(<<~MSG, caller_locations(2..2))
|
17
17
|
Extending Rails console through `Rails::ConsoleMethods` is deprecated and will be removed in Rails 8.0.
|
18
18
|
Please directly use IRB's extension API to add new commands or helpers to the console.
|
19
19
|
For more details, please visit: https://github.com/ruby/irb/blob/master/EXTEND_IRB.md
|
data/lib/rails/gem_version.rb
CHANGED
@@ -128,7 +128,7 @@ module Rails
|
|
128
128
|
template "application.rb"
|
129
129
|
template "environment.rb"
|
130
130
|
template "cable.yml" unless options[:update] || options[:skip_action_cable]
|
131
|
-
template "puma.rb"
|
131
|
+
template "puma.rb"
|
132
132
|
template "storage.yml" unless options[:update] || skip_active_storage?
|
133
133
|
|
134
134
|
directory "environments"
|
@@ -8,7 +8,7 @@
|
|
8
8
|
|
9
9
|
# Make sure RUBY_VERSION matches the Ruby version in .ruby-version
|
10
10
|
ARG RUBY_VERSION=<%= gem_ruby_version %>
|
11
|
-
FROM docker.io/library/ruby:$RUBY_VERSION-slim
|
11
|
+
FROM docker.io/library/ruby:$RUBY_VERSION-slim AS base
|
12
12
|
|
13
13
|
# Rails app lives here
|
14
14
|
WORKDIR /rails
|
@@ -25,7 +25,7 @@ ENV RAILS_ENV="production" \
|
|
25
25
|
BUNDLE_WITHOUT="development"
|
26
26
|
|
27
27
|
# Throw-away build stage to reduce size of final image
|
28
|
-
FROM base
|
28
|
+
FROM base AS build
|
29
29
|
|
30
30
|
# Install packages needed to build gems<%= using_node? ? " and node modules" : "" %>
|
31
31
|
RUN apt-get update -qq && \
|
@@ -42,6 +42,8 @@ Rails.application.configure do
|
|
42
42
|
# Don't care if the mailer can't send.
|
43
43
|
config.action_mailer.raise_delivery_errors = false
|
44
44
|
|
45
|
+
# Disable caching for Action Mailer templates even if Action Controller
|
46
|
+
# caching is enabled.
|
45
47
|
config.action_mailer.perform_caching = false
|
46
48
|
|
47
49
|
config.action_mailer.default_url_options = { host: "localhost", port: 3000 }
|
@@ -72,8 +74,8 @@ Rails.application.configure do
|
|
72
74
|
<%- unless skip_sprockets? -%>
|
73
75
|
# Suppress logger output for asset requests.
|
74
76
|
config.assets.quiet = true
|
75
|
-
<%- end -%>
|
76
77
|
|
78
|
+
<%- end -%>
|
77
79
|
# Raises error for missing translations.
|
78
80
|
# config.i18n.raise_on_missing_translations = true
|
79
81
|
|
@@ -58,6 +58,7 @@ Rails.application.configure do
|
|
58
58
|
|
59
59
|
# Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
|
60
60
|
config.force_ssl = true
|
61
|
+
|
61
62
|
# Skip http-to-https redirect for the default health check endpoint.
|
62
63
|
# config.ssl_options = { redirect: { exclude: ->(request) { request.path == "/up" } } }
|
63
64
|
|
@@ -84,6 +85,8 @@ Rails.application.configure do
|
|
84
85
|
|
85
86
|
<%- end -%>
|
86
87
|
<%- unless options.skip_action_mailer? -%>
|
88
|
+
# Disable caching for Action Mailer templates even if Action Controller
|
89
|
+
# caching is enabled.
|
87
90
|
config.action_mailer.perform_caching = false
|
88
91
|
|
89
92
|
# Ignore bad email addresses and do not raise email delivery errors.
|
@@ -37,6 +37,8 @@ Rails.application.configure do
|
|
37
37
|
|
38
38
|
<%- end -%>
|
39
39
|
<%- unless options.skip_action_mailer? -%>
|
40
|
+
# Disable caching for Action Mailer templates even if Action Controller
|
41
|
+
# caching is enabled.
|
40
42
|
config.action_mailer.perform_caching = false
|
41
43
|
|
42
44
|
# Tell Action Mailer not to deliver emails to the real world.
|
@@ -100,7 +100,7 @@ jobs:
|
|
100
100
|
<%- end -%>
|
101
101
|
steps:
|
102
102
|
- name: Install packages
|
103
|
-
run: sudo apt-get update && sudo apt-get install --no-install-recommends -y google-chrome-stable <%=
|
103
|
+
run: sudo apt-get update && sudo apt-get install --no-install-recommends -y google-chrome-stable <%= dockerfile_base_packages.join(" ") %>
|
104
104
|
|
105
105
|
- name: Checkout code
|
106
106
|
uses: actions/checkout@v4
|
@@ -12,16 +12,11 @@ services:
|
|
12
12
|
# Overrides default command so things don't shut down after the process ends.
|
13
13
|
command: sleep infinity
|
14
14
|
|
15
|
-
networks:
|
16
|
-
- default
|
17
|
-
|
18
15
|
# Uncomment the next line to use a non-root user for all processes.
|
19
16
|
# user: vscode
|
20
17
|
|
21
18
|
# Use "forwardPorts" in **devcontainer.json** to forward an app port locally.
|
22
19
|
# (Adding the "ports" property to this file will not forward from a Codespace.)
|
23
|
-
ports:
|
24
|
-
- 45678:45678
|
25
20
|
<%- if !dependencies.empty? -%>
|
26
21
|
depends_on:
|
27
22
|
<%- dependencies.each do |dependency| -%>
|
@@ -33,16 +28,12 @@ services:
|
|
33
28
|
selenium:
|
34
29
|
image: seleniarm/standalone-chromium
|
35
30
|
restart: unless-stopped
|
36
|
-
networks:
|
37
|
-
- default
|
38
31
|
<%- end -%>
|
39
32
|
|
40
33
|
<%- if options[:redis] -%>
|
41
34
|
redis:
|
42
35
|
image: redis:7.2
|
43
36
|
restart: unless-stopped
|
44
|
-
networks:
|
45
|
-
- default
|
46
37
|
volumes:
|
47
38
|
- redis-data:/data
|
48
39
|
|
@@ -64,7 +64,7 @@ jobs:
|
|
64
64
|
<%- end -%>
|
65
65
|
steps:
|
66
66
|
- name: Install packages
|
67
|
-
run: sudo apt-get update && sudo apt-get install --no-install-recommends -y google-chrome-stable <%=
|
67
|
+
run: sudo apt-get update && sudo apt-get install --no-install-recommends -y google-chrome-stable <%= dockerfile_base_packages.join(" ") %>
|
68
68
|
|
69
69
|
- name: Checkout code
|
70
70
|
uses: actions/checkout@v4
|
@@ -2,15 +2,17 @@ require "test_helper"
|
|
2
2
|
|
3
3
|
<% module_namespacing do -%>
|
4
4
|
class <%= class_name %>MailerTest < ActionMailer::TestCase
|
5
|
-
<% actions.
|
5
|
+
<% actions.each_with_index do |action, index| -%>
|
6
|
+
<% if index != 0 -%>
|
7
|
+
|
8
|
+
<% end -%>
|
6
9
|
test "<%= action %>" do
|
7
10
|
mail = <%= class_name %>Mailer.<%= action %>
|
8
11
|
assert_equal <%= action.to_s.humanize.inspect %>, mail.subject
|
9
|
-
assert_equal ["to@example.org"], mail.to
|
10
|
-
assert_equal ["from@example.com"], mail.from
|
12
|
+
assert_equal [ "to@example.org" ], mail.to
|
13
|
+
assert_equal [ "from@example.com" ], mail.from
|
11
14
|
assert_match "Hi", mail.body.encoded
|
12
15
|
end
|
13
|
-
|
14
16
|
<% end -%>
|
15
17
|
<% if actions.blank? -%>
|
16
18
|
# test "the truth" do
|
@@ -1,13 +1,14 @@
|
|
1
1
|
<% module_namespacing do -%>
|
2
2
|
# Preview all emails at http://localhost:3000/rails/mailers/<%= file_path %>_mailer
|
3
3
|
class <%= class_name %>MailerPreview < ActionMailer::Preview
|
4
|
-
<% actions.
|
4
|
+
<% actions.each_with_index do |action, index| -%>
|
5
|
+
<% if index != 0 -%>
|
5
6
|
|
7
|
+
<% end -%>
|
6
8
|
# Preview this email at http://localhost:3000/rails/mailers/<%= file_path %>_mailer/<%= action %>
|
7
9
|
def <%= action %>
|
8
10
|
<%= class_name %>Mailer.<%= action %>
|
9
11
|
end
|
10
12
|
<% end -%>
|
11
|
-
|
12
13
|
end
|
13
14
|
<% end -%>
|
@@ -39,7 +39,11 @@ module TestUnit # :nodoc:
|
|
39
39
|
|
40
40
|
private
|
41
41
|
def attributes_string
|
42
|
-
attributes_hash.
|
42
|
+
if attributes_hash.empty?
|
43
|
+
"{}"
|
44
|
+
else
|
45
|
+
"{ #{attributes_hash.map { |k, v| "#{k}: #{v}" }.join(", ")} }"
|
46
|
+
end
|
43
47
|
end
|
44
48
|
|
45
49
|
def attributes_hash
|
@@ -17,7 +17,7 @@ class <%= controller_class_name %>ControllerTest < ActionDispatch::IntegrationTe
|
|
17
17
|
|
18
18
|
test "should create <%= singular_table_name %>" do
|
19
19
|
assert_difference("<%= class_name %>.count") do
|
20
|
-
post <%= index_helper %>_url, params: { <%= "#{singular_table_name}:
|
20
|
+
post <%= index_helper %>_url, params: { <%= "#{singular_table_name}: #{attributes_string}" %> }, as: :json
|
21
21
|
end
|
22
22
|
|
23
23
|
assert_response :created
|
@@ -29,7 +29,7 @@ class <%= controller_class_name %>ControllerTest < ActionDispatch::IntegrationTe
|
|
29
29
|
end
|
30
30
|
|
31
31
|
test "should update <%= singular_table_name %>" do
|
32
|
-
patch <%= show_helper %>, params: { <%= "#{singular_table_name}:
|
32
|
+
patch <%= show_helper %>, params: { <%= "#{singular_table_name}: #{attributes_string}" %> }, as: :json
|
33
33
|
assert_response :success
|
34
34
|
end
|
35
35
|
|
@@ -22,7 +22,7 @@ class <%= controller_class_name %>ControllerTest < ActionDispatch::IntegrationTe
|
|
22
22
|
|
23
23
|
test "should create <%= singular_table_name %>" do
|
24
24
|
assert_difference("<%= class_name %>.count") do
|
25
|
-
post <%= index_helper(type: :url) %>, params: { <%= "#{singular_table_name}:
|
25
|
+
post <%= index_helper(type: :url) %>, params: { <%= "#{singular_table_name}: #{attributes_string}" %> }
|
26
26
|
end
|
27
27
|
|
28
28
|
assert_redirected_to <%= show_helper("#{class_name}.last") %>
|
@@ -39,7 +39,7 @@ class <%= controller_class_name %>ControllerTest < ActionDispatch::IntegrationTe
|
|
39
39
|
end
|
40
40
|
|
41
41
|
test "should update <%= singular_table_name %>" do
|
42
|
-
patch <%= show_helper %>, params: { <%= "#{singular_table_name}:
|
42
|
+
patch <%= show_helper %>, params: { <%= "#{singular_table_name}: #{attributes_string}" %> }
|
43
43
|
assert_redirected_to <%= show_helper %>
|
44
44
|
end
|
45
45
|
|
@@ -58,15 +58,20 @@ module Rails
|
|
58
58
|
patterns = extract_filters(argv)
|
59
59
|
tests = list_tests(patterns)
|
60
60
|
tests.to_a.each do |path|
|
61
|
-
|
61
|
+
abs_path = File.expand_path(path)
|
62
|
+
require abs_path
|
62
63
|
rescue LoadError => exception
|
63
|
-
|
64
|
-
|
64
|
+
if exception.path == abs_path
|
65
|
+
all_tests = list_tests([default_test_glob])
|
66
|
+
corrections = DidYouMean::SpellChecker.new(dictionary: all_tests).correct(path)
|
65
67
|
|
66
|
-
|
67
|
-
|
68
|
+
if corrections.empty?
|
69
|
+
raise exception
|
70
|
+
end
|
71
|
+
raise InvalidTestError.new(path, DidYouMean::Formatter.message_for(corrections))
|
72
|
+
else
|
73
|
+
raise
|
68
74
|
end
|
69
|
-
raise InvalidTestError.new(path, DidYouMean::Formatter.message_for(corrections))
|
70
75
|
end
|
71
76
|
end
|
72
77
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: railties
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 7.2.0.
|
4
|
+
version: 7.2.0.rc1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Heinemeier Hansson
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-06
|
11
|
+
date: 2024-08-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -16,28 +16,28 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 7.2.0.
|
19
|
+
version: 7.2.0.rc1
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - '='
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 7.2.0.
|
26
|
+
version: 7.2.0.rc1
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: actionpack
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - '='
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 7.2.0.
|
33
|
+
version: 7.2.0.rc1
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - '='
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 7.2.0.
|
40
|
+
version: 7.2.0.rc1
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rackup
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -120,14 +120,14 @@ dependencies:
|
|
120
120
|
requirements:
|
121
121
|
- - '='
|
122
122
|
- !ruby/object:Gem::Version
|
123
|
-
version: 7.2.0.
|
123
|
+
version: 7.2.0.rc1
|
124
124
|
type: :development
|
125
125
|
prerelease: false
|
126
126
|
version_requirements: !ruby/object:Gem::Requirement
|
127
127
|
requirements:
|
128
128
|
- - '='
|
129
129
|
- !ruby/object:Gem::Version
|
130
|
-
version: 7.2.0.
|
130
|
+
version: 7.2.0.rc1
|
131
131
|
description: 'Rails internals: application bootup, plugins, generators, and rake tasks.'
|
132
132
|
email: david@loudthinking.com
|
133
133
|
executables:
|
@@ -170,6 +170,7 @@ files:
|
|
170
170
|
- lib/rails/commands/about/about_command.rb
|
171
171
|
- lib/rails/commands/app/update_command.rb
|
172
172
|
- lib/rails/commands/application/application_command.rb
|
173
|
+
- lib/rails/commands/boot/boot_command.rb
|
173
174
|
- lib/rails/commands/console/console_command.rb
|
174
175
|
- lib/rails/commands/console/irb_console.rb
|
175
176
|
- lib/rails/commands/credentials/USAGE
|
@@ -468,10 +469,10 @@ licenses:
|
|
468
469
|
- MIT
|
469
470
|
metadata:
|
470
471
|
bug_tracker_uri: https://github.com/rails/rails/issues
|
471
|
-
changelog_uri: https://github.com/rails/rails/blob/v7.2.0.
|
472
|
-
documentation_uri: https://api.rubyonrails.org/v7.2.0.
|
472
|
+
changelog_uri: https://github.com/rails/rails/blob/v7.2.0.rc1/railties/CHANGELOG.md
|
473
|
+
documentation_uri: https://api.rubyonrails.org/v7.2.0.rc1/
|
473
474
|
mailing_list_uri: https://discuss.rubyonrails.org/c/rubyonrails-talk
|
474
|
-
source_code_uri: https://github.com/rails/rails/tree/v7.2.0.
|
475
|
+
source_code_uri: https://github.com/rails/rails/tree/v7.2.0.rc1/railties
|
475
476
|
rubygems_mfa_required: 'true'
|
476
477
|
post_install_message:
|
477
478
|
rdoc_options:
|
@@ -486,11 +487,11 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
486
487
|
version: 3.1.0
|
487
488
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
488
489
|
requirements:
|
489
|
-
- - "
|
490
|
+
- - ">="
|
490
491
|
- !ruby/object:Gem::Version
|
491
|
-
version:
|
492
|
+
version: '0'
|
492
493
|
requirements: []
|
493
|
-
rubygems_version: 3.
|
494
|
+
rubygems_version: 3.5.11
|
494
495
|
signing_key:
|
495
496
|
specification_version: 4
|
496
497
|
summary: Tools for creating, working with, and running Rails applications.
|