railties 7.0.4.3 → 7.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +30 -0
- data/README.rdoc +1 -1
- data/lib/rails/application.rb +25 -30
- data/lib/rails/application_controller.rb +1 -1
- data/lib/rails/commands/console/console_command.rb +4 -0
- data/lib/rails/commands/credentials/credentials_command.rb +1 -1
- data/lib/rails/gem_version.rb +2 -2
- data/lib/rails/generators/actions.rb +176 -48
- data/lib/rails/generators/rails/app/app_generator.rb +3 -3
- data/lib/rails/generators/rails/app/templates/config/environments/development.rb.tt +1 -1
- data/lib/rails/generators/rails/app/templates/config/environments/production.rb.tt +1 -1
- data/lib/rails/generators/rails/app/templates/config/environments/test.rb.tt +1 -1
- data/lib/rails/generators/rails/app/templates/config/initializers/new_framework_defaults_7_0.rb.tt +17 -4
- data/lib/rails/generators/rails/plugin/plugin_generator.rb +3 -2
- data/lib/rails/generators/rails/plugin/templates/%name%.gemspec.tt +2 -2
- data/lib/rails/generators/rails/plugin/templates/bin/rails.tt +3 -1
- data/lib/rails/generators/rails/scaffold_controller/templates/controller.rb.tt +1 -1
- data/lib/rails/generators/testing/behaviour.rb +1 -1
- data/lib/rails/test_help.rb +4 -0
- metadata +15 -15
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d5d76894f7ee82ab8df507eb093d755cf69c3dd1e0adb6c965865a0ea7fa1ea5
|
4
|
+
data.tar.gz: 1b8a5c3cbe5056a657f92de640b7d8db16d29b7bbc1efc226e8e37f5c0fe810d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f6af0cb8b05213f42dc7f656d3b0df7097f39337b2cdfa3e8ee383d76ff78f21b966a180bd2459a104c32c90bfd8553a6c1b2e83c468aa9a77dc7301ddae16e0
|
7
|
+
data.tar.gz: f0e75011cf18bb845a82c80f632fa2fa40e2054e44d26659abc93b5b9938880c647dd09eaba5062391745307e64b2c2fc24603f3565e5e4b21c0edd9b8c44608
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,33 @@
|
|
1
|
+
## Rails 7.0.6 (June 29, 2023) ##
|
2
|
+
|
3
|
+
* Avoid escaping paths when editing credentials.
|
4
|
+
|
5
|
+
*Jonathan Hefner*
|
6
|
+
|
7
|
+
|
8
|
+
## Rails 7.0.5.1 (June 26, 2023) ##
|
9
|
+
|
10
|
+
* No changes.
|
11
|
+
|
12
|
+
|
13
|
+
## Rails 7.0.5 (May 24, 2023) ##
|
14
|
+
|
15
|
+
* Add puma app server to Gemfile in order to start test/dummy.
|
16
|
+
|
17
|
+
*Donapieppo*
|
18
|
+
|
19
|
+
* Rails console now disables `IRB`'s autocompletion feature in production by default.
|
20
|
+
|
21
|
+
Setting `IRB_USE_AUTOCOMPLETE=true` can override this default.
|
22
|
+
|
23
|
+
*Stan Lo*
|
24
|
+
|
25
|
+
* Send 303 See Other status code back for the destroy action on newly generated
|
26
|
+
scaffold controllers.
|
27
|
+
|
28
|
+
*Tony Drake*
|
29
|
+
|
30
|
+
|
1
31
|
## Rails 7.0.4.3 (March 13, 2023) ##
|
2
32
|
|
3
33
|
* No changes.
|
data/README.rdoc
CHANGED
@@ -14,7 +14,7 @@ The latest version of Railties can be installed with RubyGems:
|
|
14
14
|
|
15
15
|
* gem install railties
|
16
16
|
|
17
|
-
Source code can be downloaded as part of the Rails project on GitHub
|
17
|
+
Source code can be downloaded as part of the \Rails project on GitHub
|
18
18
|
|
19
19
|
* https://github.com/rails/rails/tree/main/railties
|
20
20
|
|
data/lib/rails/application.rb
CHANGED
@@ -422,44 +422,39 @@ module Rails
|
|
422
422
|
end
|
423
423
|
end
|
424
424
|
|
425
|
-
#
|
426
|
-
#
|
427
|
-
#
|
428
|
-
#
|
429
|
-
#
|
430
|
-
#
|
431
|
-
#
|
425
|
+
# Returns an ActiveSupport::EncryptedConfiguration instance for the
|
426
|
+
# credentials file specified by +config.credentials.content_path+.
|
427
|
+
#
|
428
|
+
# By default, +config.credentials.content_path+ will point to either
|
429
|
+
# <tt>config/credentials/#{environment}.yml.enc</tt> for the current
|
430
|
+
# environment (for example, +config/credentials/production.yml.enc+ for the
|
431
|
+
# +production+ environment), or +config/credentials.yml.enc+ if that file
|
432
|
+
# does not exist.
|
433
|
+
#
|
434
|
+
# The encryption key is taken from either <tt>ENV["RAILS_MASTER_KEY"]</tt>,
|
435
|
+
# or from the file specified by +config.credentials.key_path+. By default,
|
436
|
+
# +config.credentials.key_path+ will point to either
|
437
|
+
# <tt>config/credentials/#{environment}.key</tt> for the current
|
438
|
+
# environment, or +config/master.key+ if that file does not exist.
|
432
439
|
def credentials
|
433
440
|
@credentials ||= encrypted(config.credentials.content_path, key_path: config.credentials.key_path)
|
434
441
|
end
|
435
442
|
|
436
|
-
#
|
437
|
-
#
|
438
|
-
#
|
439
|
-
# the file with the master key.
|
440
|
-
# The master key is either stored in +config/master.key+ or <tt>ENV["RAILS_MASTER_KEY"]</tt>.
|
441
|
-
#
|
442
|
-
# Rails.application.encrypted("config/mystery_man.txt.enc").read
|
443
|
-
# # => "We've met before, haven't we?"
|
444
|
-
#
|
445
|
-
# It's also possible to interpret encrypted YAML files with +config+.
|
446
|
-
#
|
447
|
-
# Rails.application.encrypted("config/credentials.yml.enc").config
|
448
|
-
# # => { next_guys_line: "I don't think so. Where was it you think we met?" }
|
449
|
-
#
|
450
|
-
# Any top-level configs are also accessible directly on the return value:
|
451
|
-
#
|
452
|
-
# Rails.application.encrypted("config/credentials.yml.enc").next_guys_line
|
453
|
-
# # => "I don't think so. Where was it you think we met?"
|
443
|
+
# Returns an ActiveSupport::EncryptedConfiguration instance for an encrypted
|
444
|
+
# file. By default, the encryption key is taken from either
|
445
|
+
# <tt>ENV["RAILS_MASTER_KEY"]</tt>, or from the +config/master.key+ file.
|
454
446
|
#
|
455
|
-
#
|
456
|
-
# a key in the +ENV+, use:
|
447
|
+
# my_config = Rails.application.encrypted("config/my_config.enc")
|
457
448
|
#
|
458
|
-
#
|
449
|
+
# my_config.read
|
450
|
+
# # => "foo:\n bar: 123\n"
|
459
451
|
#
|
460
|
-
#
|
452
|
+
# my_config.foo.bar
|
453
|
+
# # => 123
|
461
454
|
#
|
462
|
-
#
|
455
|
+
# Encrypted files can be edited with the <tt>bin/rails encrypted:edit</tt>
|
456
|
+
# command. (See the output of <tt>bin/rails encrypted:edit --help</tt> for
|
457
|
+
# more information.)
|
463
458
|
def encrypted(path, key_path: "config/master.key", env_key: "RAILS_MASTER_KEY")
|
464
459
|
ActiveSupport::EncryptedConfiguration.new(
|
465
460
|
config_path: Rails.root.join(path),
|
@@ -1,7 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
class Rails::ApplicationController < ActionController::Base # :nodoc:
|
4
|
-
|
4
|
+
prepend_view_path File.expand_path("templates", __dir__)
|
5
5
|
layout "application"
|
6
6
|
|
7
7
|
before_action :disable_content_security_policy_nonce!
|
data/lib/rails/gem_version.rb
CHANGED
@@ -12,13 +12,58 @@ module Rails
|
|
12
12
|
@indentation = 0
|
13
13
|
end
|
14
14
|
|
15
|
-
# Adds
|
15
|
+
# Adds a +gem+ declaration to the +Gemfile+ for the specified gem.
|
16
16
|
#
|
17
17
|
# gem "rspec", group: :test
|
18
18
|
# gem "technoweenie-restful-authentication", lib: "restful-authentication", source: "http://gems.github.com/"
|
19
19
|
# gem "rails", "3.0", git: "https://github.com/rails/rails"
|
20
20
|
# gem "RedCloth", ">= 4.1.0", "< 4.2.0"
|
21
21
|
# gem "rspec", comment: "Put this comment above the gem declaration"
|
22
|
+
#
|
23
|
+
# Note that this method only adds the gem to the +Gemfile+; it does not
|
24
|
+
# install the gem.
|
25
|
+
#
|
26
|
+
# ==== Options
|
27
|
+
#
|
28
|
+
# [+:version+]
|
29
|
+
# The version constraints for the gem, specified as a string or an
|
30
|
+
# array of strings:
|
31
|
+
#
|
32
|
+
# gem "my_gem", version: "~> 1.1"
|
33
|
+
# gem "my_gem", version: [">= 1.1", "< 2.0"]
|
34
|
+
#
|
35
|
+
# Alternatively, can be specified as one or more arguments following the
|
36
|
+
# gem name:
|
37
|
+
#
|
38
|
+
# gem "my_gem", ">= 1.1", "< 2.0"
|
39
|
+
#
|
40
|
+
# [+:comment+]
|
41
|
+
# Outputs a comment above the +gem+ declaration in the +Gemfile+.
|
42
|
+
#
|
43
|
+
# gem "my_gem", comment: "First line.\nSecond line."
|
44
|
+
#
|
45
|
+
# Outputs:
|
46
|
+
#
|
47
|
+
# # First line.
|
48
|
+
# # Second line.
|
49
|
+
# gem "my_gem"
|
50
|
+
#
|
51
|
+
# [+:group+]
|
52
|
+
# The gem group in the +Gemfile+ that the gem belongs to.
|
53
|
+
#
|
54
|
+
# [+:git+]
|
55
|
+
# The URL of the git repository for the gem.
|
56
|
+
#
|
57
|
+
# Any additional options passed to this method will be appended to the
|
58
|
+
# +gem+ declaration in the +Gemfile+. For example:
|
59
|
+
#
|
60
|
+
# gem "my_gem", comment: "Edge my_gem", git: "https://example.com/my_gem.git", branch: "master"
|
61
|
+
#
|
62
|
+
# Outputs:
|
63
|
+
#
|
64
|
+
# # Edge my_gem
|
65
|
+
# gem "my_gem", git: "https://example.com/my_gem.git", branch: "master"
|
66
|
+
#
|
22
67
|
def gem(*args)
|
23
68
|
options = args.extract_options!
|
24
69
|
name, *versions = args
|
@@ -117,18 +162,47 @@ module Rails
|
|
117
162
|
end
|
118
163
|
end
|
119
164
|
|
120
|
-
# Adds
|
165
|
+
# Adds configuration code to a Rails runtime environment.
|
166
|
+
#
|
167
|
+
# By default, adds code inside the +Application+ class in
|
168
|
+
# +config/application.rb+ so that it applies to all environments.
|
169
|
+
#
|
170
|
+
# environment %(config.asset_host = "cdn.provider.com")
|
171
|
+
#
|
172
|
+
# Results in:
|
173
|
+
#
|
174
|
+
# # config/application.rb
|
175
|
+
# class Application < Rails::Application
|
176
|
+
# config.asset_host = "cdn.provider.com"
|
177
|
+
# # ...
|
178
|
+
# end
|
179
|
+
#
|
180
|
+
# If the +:env+ option is specified, the code will be added to the
|
181
|
+
# corresponding file in +config/environments+ instead.
|
182
|
+
#
|
183
|
+
# environment %(config.asset_host = "localhost:3000"), env: "development"
|
184
|
+
#
|
185
|
+
# Results in:
|
121
186
|
#
|
122
|
-
#
|
123
|
-
#
|
187
|
+
# # config/environments/development.rb
|
188
|
+
# Rails.application.configure do
|
189
|
+
# config.asset_host = "localhost:3000"
|
190
|
+
# # ...
|
191
|
+
# end
|
192
|
+
#
|
193
|
+
# +:env+ can also be an array. In which case, the code is added to each
|
194
|
+
# corresponding file in +config/environments+.
|
195
|
+
#
|
196
|
+
# The code can also be specified as the return value of the block:
|
124
197
|
#
|
125
198
|
# environment do
|
126
|
-
#
|
199
|
+
# %(config.asset_host = "cdn.provider.com")
|
127
200
|
# end
|
128
201
|
#
|
129
202
|
# environment(nil, env: "development") do
|
130
|
-
#
|
203
|
+
# %(config.asset_host = "localhost:3000")
|
131
204
|
# end
|
205
|
+
#
|
132
206
|
def environment(data = nil, options = {})
|
133
207
|
sentinel = "class Application < Rails::Application\n"
|
134
208
|
env_file_sentinel = "Rails.application.configure do\n"
|
@@ -146,11 +220,20 @@ module Rails
|
|
146
220
|
end
|
147
221
|
alias :application :environment
|
148
222
|
|
149
|
-
#
|
223
|
+
# Runs one or more git commands.
|
150
224
|
#
|
151
225
|
# git :init
|
226
|
+
# # => runs `git init`
|
227
|
+
#
|
152
228
|
# git add: "this.file that.rb"
|
153
|
-
# git add
|
229
|
+
# # => runs `git add this.file that.rb`
|
230
|
+
#
|
231
|
+
# git commit: "-m 'First commit'"
|
232
|
+
# # => runs `git commit -m 'First commit'`
|
233
|
+
#
|
234
|
+
# git add: "good.rb", rm: "bad.cxx"
|
235
|
+
# # => runs `git add good.rb; git rm bad.cxx`
|
236
|
+
#
|
154
237
|
def git(commands = {})
|
155
238
|
if commands.is_a?(Symbol)
|
156
239
|
run "git #{commands}"
|
@@ -161,80 +244,91 @@ module Rails
|
|
161
244
|
end
|
162
245
|
end
|
163
246
|
|
164
|
-
#
|
165
|
-
#
|
247
|
+
# Creates a file in +vendor/+. The contents can be specified as an
|
248
|
+
# argument or as the return value of the block.
|
249
|
+
#
|
250
|
+
# vendor "foreign.rb", <<~RUBY
|
251
|
+
# # Foreign code is fun
|
252
|
+
# RUBY
|
166
253
|
#
|
167
|
-
# vendor
|
168
|
-
#
|
169
|
-
# "salt = '#{sekrit_salt}'"
|
254
|
+
# vendor "foreign.rb" do
|
255
|
+
# "# Foreign code is fun"
|
170
256
|
# end
|
171
257
|
#
|
172
|
-
# vendor("foreign.rb", "# Foreign code is fun")
|
173
258
|
def vendor(filename, data = nil)
|
174
259
|
log :vendor, filename
|
175
260
|
data ||= yield if block_given?
|
176
261
|
create_file("vendor/#{filename}", optimize_indentation(data), verbose: false)
|
177
262
|
end
|
178
263
|
|
179
|
-
#
|
180
|
-
#
|
264
|
+
# Creates a file in +lib/+. The contents can be specified as an argument
|
265
|
+
# or as the return value of the block.
|
266
|
+
#
|
267
|
+
# lib "foreign.rb", <<~RUBY
|
268
|
+
# # Foreign code is fun
|
269
|
+
# RUBY
|
181
270
|
#
|
182
|
-
# lib
|
183
|
-
# "
|
271
|
+
# lib "foreign.rb" do
|
272
|
+
# "# Foreign code is fun"
|
184
273
|
# end
|
185
274
|
#
|
186
|
-
# lib("foreign.rb", "# Foreign code is fun")
|
187
275
|
def lib(filename, data = nil)
|
188
276
|
log :lib, filename
|
189
277
|
data ||= yield if block_given?
|
190
278
|
create_file("lib/#{filename}", optimize_indentation(data), verbose: false)
|
191
279
|
end
|
192
280
|
|
193
|
-
#
|
281
|
+
# Creates a Rake tasks file in +lib/tasks/+. The code can be specified as
|
282
|
+
# an argument or as the return value of the block.
|
194
283
|
#
|
195
|
-
# rakefile
|
284
|
+
# rakefile "bootstrap.rake", <<~RUBY
|
285
|
+
# task :bootstrap do
|
286
|
+
# puts "Boots! Boots! Boots!"
|
287
|
+
# end
|
288
|
+
# RUBY
|
289
|
+
#
|
290
|
+
# rakefile "bootstrap.rake" do
|
196
291
|
# project = ask("What is the UNIX name of your project?")
|
197
292
|
#
|
198
|
-
#
|
293
|
+
# <<~RUBY
|
199
294
|
# namespace :#{project} do
|
200
295
|
# task :bootstrap do
|
201
|
-
# puts "
|
296
|
+
# puts "Boots! Boots! Boots!"
|
202
297
|
# end
|
203
298
|
# end
|
204
|
-
#
|
299
|
+
# RUBY
|
205
300
|
# end
|
206
301
|
#
|
207
|
-
# rakefile('seed.rake', 'puts "Planting seeds"')
|
208
302
|
def rakefile(filename, data = nil)
|
209
303
|
log :rakefile, filename
|
210
304
|
data ||= yield if block_given?
|
211
305
|
create_file("lib/tasks/#{filename}", optimize_indentation(data), verbose: false)
|
212
306
|
end
|
213
307
|
|
214
|
-
#
|
308
|
+
# Creates an initializer file in +config/initializers/+. The code can be
|
309
|
+
# specified as an argument or as the return value of the block.
|
215
310
|
#
|
216
|
-
# initializer
|
217
|
-
#
|
311
|
+
# initializer "api.rb", <<~RUBY
|
312
|
+
# API_KEY = "123456"
|
313
|
+
# RUBY
|
218
314
|
#
|
219
|
-
#
|
220
|
-
#
|
221
|
-
# end
|
222
|
-
#
|
223
|
-
# data
|
315
|
+
# initializer "api.rb" do
|
316
|
+
# %(API_KEY = "123456")
|
224
317
|
# end
|
225
318
|
#
|
226
|
-
# initializer("api.rb", "API_KEY = '123456'")
|
227
319
|
def initializer(filename, data = nil)
|
228
320
|
log :initializer, filename
|
229
321
|
data ||= yield if block_given?
|
230
322
|
create_file("config/initializers/#{filename}", optimize_indentation(data), verbose: false)
|
231
323
|
end
|
232
324
|
|
233
|
-
#
|
234
|
-
#
|
235
|
-
#
|
325
|
+
# Runs another generator.
|
326
|
+
#
|
327
|
+
# generate "scaffold", "Post title:string body:text"
|
328
|
+
# generate "scaffold", "Post", "title:string", "body:text"
|
236
329
|
#
|
237
|
-
#
|
330
|
+
# The first argument is the generator name, and the remaining arguments
|
331
|
+
# are joined together and passed to the generator.
|
238
332
|
def generate(what, *args)
|
239
333
|
log :generate, what
|
240
334
|
|
@@ -244,22 +338,56 @@ module Rails
|
|
244
338
|
rails_command "generate #{what} #{args.join(" ")}", options
|
245
339
|
end
|
246
340
|
|
247
|
-
# Runs the
|
341
|
+
# Runs the specified Rake task.
|
342
|
+
#
|
343
|
+
# rake "db:migrate"
|
344
|
+
# rake "db:migrate", env: "production"
|
345
|
+
# rake "db:migrate", abort_on_failure: true
|
346
|
+
# rake "stats", capture: true
|
347
|
+
# rake "gems:install", sudo: true
|
348
|
+
#
|
349
|
+
# ==== Options
|
350
|
+
#
|
351
|
+
# [+:env+]
|
352
|
+
# The Rails environment in which to run the task. Defaults to
|
353
|
+
# <tt>ENV["RAILS_ENV"] || "development"</tt>.
|
354
|
+
#
|
355
|
+
# [+:abort_on_failure+]
|
356
|
+
# Whether to halt the generator if the task exits with a non-success
|
357
|
+
# exit status.
|
248
358
|
#
|
249
|
-
#
|
250
|
-
#
|
251
|
-
#
|
252
|
-
#
|
359
|
+
# [+:capture+]
|
360
|
+
# Whether to capture and return the output of the task.
|
361
|
+
#
|
362
|
+
# [+:sudo+]
|
363
|
+
# Whether to run the task using +sudo+.
|
253
364
|
def rake(command, options = {})
|
254
365
|
execute_command :rake, command, options
|
255
366
|
end
|
256
367
|
|
257
|
-
# Runs the
|
368
|
+
# Runs the specified Rails command.
|
369
|
+
#
|
370
|
+
# rails_command "db:migrate"
|
371
|
+
# rails_command "db:migrate", env: "production"
|
372
|
+
# rails_command "db:migrate", abort_on_failure: true
|
373
|
+
# rails_command "stats", capture: true
|
374
|
+
# rails_command "gems:install", sudo: true
|
375
|
+
#
|
376
|
+
# ==== Options
|
377
|
+
#
|
378
|
+
# [+:env+]
|
379
|
+
# The Rails environment in which to run the command. Defaults to
|
380
|
+
# <tt>ENV["RAILS_ENV"] || "development"</tt>.
|
381
|
+
#
|
382
|
+
# [+:abort_on_failure+]
|
383
|
+
# Whether to halt the generator if the command exits with a non-success
|
384
|
+
# exit status.
|
385
|
+
#
|
386
|
+
# [+:capture+]
|
387
|
+
# Whether to capture and return the output of the command.
|
258
388
|
#
|
259
|
-
#
|
260
|
-
#
|
261
|
-
# rails_command("gems:install", sudo: true)
|
262
|
-
# rails_command("gems:install", capture: true)
|
389
|
+
# [+:sudo+]
|
390
|
+
# Whether to run the command using +sudo+.
|
263
391
|
def rails_command(command, options = {})
|
264
392
|
if options[:inline]
|
265
393
|
log :rails, command
|
@@ -274,7 +274,7 @@ module Rails
|
|
274
274
|
class_option :api, type: :boolean, desc: "Preconfigure smaller stack for API only apps"
|
275
275
|
class_option :minimal, type: :boolean, desc: "Preconfigure a minimal rails app"
|
276
276
|
class_option :javascript, type: :string, aliases: "-j", default: "importmap", desc: "Choose JavaScript approach [options: importmap (default), webpack, esbuild, rollup]"
|
277
|
-
class_option :css, type: :string, aliases: "-c", desc: "Choose CSS processor [options: tailwind, bootstrap, bulma, postcss, sass
|
277
|
+
class_option :css, type: :string, aliases: "-c", desc: "Choose CSS processor [options: tailwind, bootstrap, bulma, postcss, sass] check https://github.com/rails/cssbundling-rails"
|
278
278
|
class_option :skip_bundle, type: :boolean, aliases: "-B", default: false, desc: "Don't run bundle install"
|
279
279
|
|
280
280
|
def initialize(*args)
|
@@ -438,7 +438,7 @@ module Rails
|
|
438
438
|
|
439
439
|
def delete_app_views_if_api_option
|
440
440
|
if options[:api]
|
441
|
-
if
|
441
|
+
if skip_action_mailer?
|
442
442
|
remove_dir "app/views"
|
443
443
|
else
|
444
444
|
remove_file "app/views/layouts/application.html.erb"
|
@@ -483,7 +483,7 @@ module Rails
|
|
483
483
|
end
|
484
484
|
|
485
485
|
def delete_action_mailer_files_skipping_action_mailer
|
486
|
-
if
|
486
|
+
if skip_action_mailer?
|
487
487
|
remove_file "app/views/layouts/mailer.html.erb"
|
488
488
|
remove_file "app/views/layouts/mailer.text.erb"
|
489
489
|
remove_dir "app/mailers"
|
@@ -39,7 +39,7 @@ Rails.application.configure do
|
|
39
39
|
# Store uploaded files on the local file system (see config/storage.yml for options).
|
40
40
|
config.active_storage.service = :local
|
41
41
|
<%- end -%>
|
42
|
-
<%- unless
|
42
|
+
<%- unless skip_action_mailer? -%>
|
43
43
|
|
44
44
|
# Don't care if the mailer can't send.
|
45
45
|
config.action_mailer.raise_delivery_errors = false
|
@@ -72,7 +72,7 @@ Rails.application.configure do
|
|
72
72
|
# config.active_job.queue_name_prefix = "<%= app_name %>_production"
|
73
73
|
|
74
74
|
<%- end -%>
|
75
|
-
<%- unless
|
75
|
+
<%- unless skip_action_mailer? -%>
|
76
76
|
config.action_mailer.perform_caching = false
|
77
77
|
|
78
78
|
# Ignore bad email addresses and do not raise email delivery errors.
|
@@ -38,7 +38,7 @@ Rails.application.configure do
|
|
38
38
|
config.active_storage.service = :test
|
39
39
|
|
40
40
|
<%- end -%>
|
41
|
-
<%- unless
|
41
|
+
<%- unless skip_action_mailer? -%>
|
42
42
|
config.action_mailer.perform_caching = false
|
43
43
|
|
44
44
|
# Tell Action Mailer not to deliver emails to the real world.
|
data/lib/rails/generators/rails/app/templates/config/initializers/new_framework_defaults_7_0.rb.tt
CHANGED
@@ -109,7 +109,7 @@
|
|
109
109
|
|
110
110
|
|
111
111
|
# Cookie serializer: 2 options
|
112
|
-
#
|
112
|
+
#
|
113
113
|
# If you're upgrading and haven't set `cookies_serializer` previously, your cookie serializer
|
114
114
|
# is `:marshal`. The default for new apps is `:json`.
|
115
115
|
#
|
@@ -117,10 +117,10 @@
|
|
117
117
|
#
|
118
118
|
#
|
119
119
|
# To migrate an existing application to the `:json` serializer, use the `:hybrid` option.
|
120
|
-
#
|
120
|
+
#
|
121
121
|
# Rails transparently deserializes existing (Marshal-serialized) cookies on read and
|
122
122
|
# re-writes them in the JSON format.
|
123
|
-
#
|
123
|
+
#
|
124
124
|
# It is fine to use `:hybrid` long term; you should do that until you're confident *all* your cookies
|
125
125
|
# have been converted to JSON. To keep using `:hybrid` long term, move this config to its own
|
126
126
|
# initializer or to `config/application.rb`.
|
@@ -131,5 +131,18 @@
|
|
131
131
|
# If your cookies can't yet be serialized to JSON, keep using `:marshal` for backward-compatibility.
|
132
132
|
#
|
133
133
|
# If you have configured the serializer elsewhere, you can remove this section of the file.
|
134
|
-
#
|
134
|
+
#
|
135
135
|
# See https://guides.rubyonrails.org/action_controller_overview.html#cookies for more information.
|
136
|
+
|
137
|
+
# Change the return value of `ActionDispatch::Request#content_type` to the Content-Type header without modification.
|
138
|
+
# Rails.application.config.action_dispatch.return_only_request_media_type_on_content_type = false
|
139
|
+
|
140
|
+
# Active Storage `has_many_attached` relationships will default to replacing the current collection instead of appending to it.
|
141
|
+
# Thus, to support submitting an empty collection, the `file_field` helper will render an hidden field `include_hidden` by default when `multiple_file_field_include_hidden` is set to `true`.
|
142
|
+
# See https://guides.rubyonrails.org/configuring.html#config-active-storage-multiple-file-field-include-hidden for more information.
|
143
|
+
# Rails.application.config.active_storage.multiple_file_field_include_hidden = true
|
144
|
+
|
145
|
+
# ** Please read carefully, this must be configured in config/application.rb (NOT this file) **
|
146
|
+
# Disables the deprecated #to_s override in some Ruby core classes
|
147
|
+
# See https://guides.rubyonrails.org/configuring.html#config-active-support-disable-to-s-conversion for more information.
|
148
|
+
# config.active_support.disable_to_s_conversion = true
|
@@ -28,14 +28,14 @@ module Rails
|
|
28
28
|
|
29
29
|
empty_directory_with_keep_file "app/models/concerns"
|
30
30
|
empty_directory_with_keep_file "app/controllers/concerns"
|
31
|
-
remove_dir "app/mailers" if
|
31
|
+
remove_dir "app/mailers" if skip_action_mailer?
|
32
32
|
remove_dir "app/jobs" if options[:skip_active_job]
|
33
33
|
elsif full?
|
34
34
|
empty_directory_with_keep_file "app/models"
|
35
35
|
empty_directory_with_keep_file "app/controllers"
|
36
36
|
empty_directory_with_keep_file "app/models/concerns"
|
37
37
|
empty_directory_with_keep_file "app/controllers/concerns"
|
38
|
-
empty_directory_with_keep_file "app/mailers" unless
|
38
|
+
empty_directory_with_keep_file "app/mailers" unless skip_action_mailer?
|
39
39
|
empty_directory_with_keep_file "app/jobs" unless options[:skip_active_job]
|
40
40
|
|
41
41
|
unless api?
|
@@ -317,6 +317,7 @@ module Rails
|
|
317
317
|
[
|
318
318
|
rails_gemfile_entry,
|
319
319
|
simplify_gemfile_entries(
|
320
|
+
web_server_gemfile_entry,
|
320
321
|
database_gemfile_entry,
|
321
322
|
asset_pipeline_gemfile_entry,
|
322
323
|
),
|
@@ -8,9 +8,9 @@ Gem::Specification.new do |spec|
|
|
8
8
|
spec.homepage = "TODO"
|
9
9
|
spec.summary = "TODO: Summary of <%= camelized_modules %>."
|
10
10
|
spec.description = "TODO: Description of <%= camelized_modules %>."
|
11
|
-
|
11
|
+
<%- unless inside_application? -%>
|
12
12
|
spec.license = "MIT"
|
13
|
-
|
13
|
+
<%- end -%>
|
14
14
|
|
15
15
|
# Prevent pushing this gem to RubyGems.org. To allow pushes either set the "allowed_push_host"
|
16
16
|
# to allow pushing to a single host or delete this section to allow pushing to any host.
|
@@ -17,11 +17,13 @@ require "rails/all"
|
|
17
17
|
require "rails"
|
18
18
|
# Pick the frameworks you want:
|
19
19
|
require "active_model/railtie"
|
20
|
-
require "active_job/railtie"
|
20
|
+
<%= comment_if :skip_active_job %>require "active_job/railtie"
|
21
21
|
<%= comment_if :skip_active_record %>require "active_record/railtie"
|
22
22
|
<%= comment_if :skip_active_storage %>require "active_storage/engine"
|
23
23
|
require "action_controller/railtie"
|
24
24
|
<%= comment_if :skip_action_mailer %>require "action_mailer/railtie"
|
25
|
+
<%= comment_if :skip_action_mailbox %>require "action_mailbox/engine"
|
26
|
+
<%= comment_if :skip_action_text %>require "action_text/engine"
|
25
27
|
require "action_view/railtie"
|
26
28
|
<%= comment_if :skip_action_cable %>require "action_cable/engine"
|
27
29
|
<%= comment_if :skip_test %>require "rails/test_unit/railtie"
|
@@ -43,7 +43,7 @@ class <%= controller_class_name %>Controller < ApplicationController
|
|
43
43
|
# DELETE <%= route_url %>/1
|
44
44
|
def destroy
|
45
45
|
@<%= orm_instance.destroy %>
|
46
|
-
redirect_to <%= index_helper %>_url, notice: <%= %("#{human_name} was successfully destroyed.")
|
46
|
+
redirect_to <%= index_helper %>_url, notice: <%= %("#{human_name} was successfully destroyed.") %>, status: :see_other
|
47
47
|
end
|
48
48
|
|
49
49
|
private
|
@@ -67,7 +67,7 @@ module Rails
|
|
67
67
|
def run_generator(args = default_arguments, config = {})
|
68
68
|
capture(:stdout) do
|
69
69
|
args += ["--skip-bundle"] unless args.include?("--no-skip-bundle") || args.include?("--dev")
|
70
|
-
args
|
70
|
+
args += ["--skip-bootsnap"] unless args.include?("--no-skip-bootsnap") || args.include?("--skip-bootsnap")
|
71
71
|
|
72
72
|
generator_class.start(args, config.reverse_merge(destination_root: destination_root))
|
73
73
|
end
|
data/lib/rails/test_help.rb
CHANGED
@@ -31,6 +31,10 @@ if defined?(ActiveRecord::Base)
|
|
31
31
|
ActiveSupport.on_load(:action_dispatch_integration_test) do
|
32
32
|
self.fixture_path = ActiveSupport::TestCase.fixture_path
|
33
33
|
end
|
34
|
+
else
|
35
|
+
ActiveSupport.on_load(:active_support_test_case) do
|
36
|
+
self.file_fixture_path = "#{Rails.root}/test/fixtures/files"
|
37
|
+
end
|
34
38
|
end
|
35
39
|
|
36
40
|
# :enddoc:
|
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.0.
|
4
|
+
version: 7.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Heinemeier Hansson
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-06-29 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.0.
|
19
|
+
version: 7.0.6
|
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.0.
|
26
|
+
version: 7.0.6
|
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.0.
|
33
|
+
version: 7.0.6
|
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.0.
|
40
|
+
version: 7.0.6
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rake
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -100,14 +100,14 @@ dependencies:
|
|
100
100
|
requirements:
|
101
101
|
- - '='
|
102
102
|
- !ruby/object:Gem::Version
|
103
|
-
version: 7.0.
|
103
|
+
version: 7.0.6
|
104
104
|
type: :development
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
108
|
- - '='
|
109
109
|
- !ruby/object:Gem::Version
|
110
|
-
version: 7.0.
|
110
|
+
version: 7.0.6
|
111
111
|
description: 'Rails internals: application bootup, plugins, generators, and rake tasks.'
|
112
112
|
email: david@loudthinking.com
|
113
113
|
executables:
|
@@ -422,12 +422,12 @@ licenses:
|
|
422
422
|
- MIT
|
423
423
|
metadata:
|
424
424
|
bug_tracker_uri: https://github.com/rails/rails/issues
|
425
|
-
changelog_uri: https://github.com/rails/rails/blob/v7.0.
|
426
|
-
documentation_uri: https://api.rubyonrails.org/v7.0.
|
425
|
+
changelog_uri: https://github.com/rails/rails/blob/v7.0.6/railties/CHANGELOG.md
|
426
|
+
documentation_uri: https://api.rubyonrails.org/v7.0.6/
|
427
427
|
mailing_list_uri: https://discuss.rubyonrails.org/c/rubyonrails-talk
|
428
|
-
source_code_uri: https://github.com/rails/rails/tree/v7.0.
|
428
|
+
source_code_uri: https://github.com/rails/rails/tree/v7.0.6/railties
|
429
429
|
rubygems_mfa_required: 'true'
|
430
|
-
post_install_message:
|
430
|
+
post_install_message:
|
431
431
|
rdoc_options:
|
432
432
|
- "--exclude"
|
433
433
|
- "."
|
@@ -444,8 +444,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
444
444
|
- !ruby/object:Gem::Version
|
445
445
|
version: '0'
|
446
446
|
requirements: []
|
447
|
-
rubygems_version: 3.4.
|
448
|
-
signing_key:
|
447
|
+
rubygems_version: 3.4.13
|
448
|
+
signing_key:
|
449
449
|
specification_version: 4
|
450
450
|
summary: Tools for creating, working with, and running Rails applications.
|
451
451
|
test_files: []
|