railties 7.2.1.2 → 8.0.0.beta1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +111 -297
- data/lib/minitest/rails_plugin.rb +1 -1
- data/lib/rails/application/configuration.rb +15 -2
- data/lib/rails/application/default_middleware_stack.rb +4 -0
- data/lib/rails/application/finisher.rb +2 -2
- data/lib/rails/application/routes_reloader.rb +11 -1
- data/lib/rails/application.rb +5 -0
- data/lib/rails/code_statistics.rb +128 -86
- data/lib/rails/code_statistics_calculator.rb +78 -76
- data/lib/rails/command/helpers/editor.rb +1 -1
- data/lib/rails/commands/app/update_command.rb +1 -9
- data/lib/rails/commands/credentials/USAGE +4 -4
- data/lib/rails/commands/credentials/credentials_command.rb +5 -1
- data/lib/rails/commands/dev/dev_command.rb +1 -1
- data/lib/rails/commands/devcontainer/devcontainer_command.rb +1 -1
- data/lib/rails/commands/stats/stats_command.rb +19 -0
- data/lib/rails/dev_caching.rb +2 -2
- data/lib/rails/engine/configuration.rb +3 -1
- data/lib/rails/engine/lazy_route_set.rb +109 -0
- data/lib/rails/engine.rb +10 -5
- data/lib/rails/gem_version.rb +4 -4
- data/lib/rails/generators/app_base.rb +46 -24
- data/lib/rails/generators/database.rb +101 -67
- data/lib/rails/generators/erb/authentication/authentication_generator.rb +15 -0
- data/lib/rails/generators/erb/authentication/templates/views/passwords/edit.html.erb +9 -0
- data/lib/rails/generators/erb/authentication/templates/views/passwords/new.html.erb +8 -0
- data/lib/rails/generators/erb/authentication/templates/views/sessions/new.html.erb +11 -0
- data/lib/rails/generators/generated_attribute.rb +16 -11
- data/lib/rails/generators/rails/app/app_generator.rb +19 -32
- data/lib/rails/generators/rails/app/templates/Dockerfile.tt +12 -3
- data/lib/rails/generators/rails/app/templates/Gemfile.tt +23 -8
- data/lib/rails/generators/rails/app/templates/app/assets/stylesheets/application.css.tt +6 -11
- data/lib/rails/generators/rails/app/templates/app/views/layouts/application.html.erb.tt +10 -3
- data/lib/rails/generators/rails/app/templates/bin/dev.tt +1 -0
- data/lib/rails/generators/rails/app/templates/bin/setup.tt +5 -7
- data/lib/rails/generators/rails/app/templates/bin/thrust.tt +4 -0
- data/lib/rails/generators/rails/app/templates/config/databases/mysql.yml.tt +23 -0
- data/lib/rails/generators/rails/app/templates/config/databases/postgresql.yml.tt +23 -0
- data/lib/rails/generators/rails/app/templates/config/databases/sqlite3.yml.tt +40 -0
- data/lib/rails/generators/rails/app/templates/config/databases/trilogy.yml.tt +23 -0
- data/lib/rails/generators/rails/app/templates/config/deploy.yml.tt +124 -0
- data/lib/rails/generators/rails/app/templates/config/environments/development.rb.tt +12 -23
- data/lib/rails/generators/rails/app/templates/config/environments/production.rb.tt +34 -51
- data/lib/rails/generators/rails/app/templates/config/environments/test.rb.tt +5 -19
- data/lib/rails/generators/rails/app/templates/config/initializers/assets.rb.tt +0 -7
- data/lib/rails/generators/rails/app/templates/config/initializers/filter_parameter_logging.rb.tt +1 -1
- data/lib/rails/generators/rails/app/templates/config/initializers/new_framework_defaults_8_0.rb.tt +25 -0
- data/lib/rails/generators/rails/app/templates/config/puma.rb.tt +11 -2
- data/lib/rails/generators/rails/app/templates/config/routes.rb.tt +3 -3
- data/lib/rails/generators/rails/app/templates/docker-entrypoint.tt +4 -3
- data/lib/rails/generators/rails/app/templates/dockerignore.tt +1 -2
- data/lib/rails/generators/rails/app/templates/github/ci.yml.tt +1 -1
- data/lib/rails/generators/rails/app/templates/gitignore.tt +1 -2
- data/lib/rails/generators/rails/app/templates/kamal-secrets.tt +17 -0
- data/lib/rails/generators/rails/app/templates/public/400.html +114 -0
- data/lib/rails/generators/rails/app/templates/public/404.html +113 -66
- data/lib/rails/generators/rails/app/templates/public/406-unsupported-browser.html +113 -65
- data/lib/rails/generators/rails/app/templates/public/422.html +113 -66
- data/lib/rails/generators/rails/app/templates/public/500.html +113 -65
- data/lib/rails/generators/rails/app/templates/public/icon.png +0 -0
- data/lib/rails/generators/rails/app/templates/public/icon.svg +2 -2
- data/lib/rails/generators/rails/authentication/USAGE +6 -0
- data/lib/rails/generators/rails/authentication/authentication_generator.rb +54 -0
- data/lib/rails/generators/rails/authentication/templates/controllers/concerns/authentication.rb +55 -0
- data/lib/rails/generators/rails/authentication/templates/controllers/passwords_controller.rb +33 -0
- data/lib/rails/generators/rails/authentication/templates/controllers/sessions_controller.rb +21 -0
- data/lib/rails/generators/rails/authentication/templates/mailers/passwords_mailer.rb +6 -0
- data/lib/rails/generators/rails/authentication/templates/models/current.rb +4 -0
- data/lib/rails/generators/rails/authentication/templates/models/session.rb +3 -0
- data/lib/rails/generators/rails/authentication/templates/models/user.rb +6 -0
- data/lib/rails/generators/rails/authentication/templates/test/mailers/previews/passwords_mailer_preview.rb +7 -0
- data/lib/rails/generators/rails/authentication/templates/views/passwords_mailer/reset.html.erb +4 -0
- data/lib/rails/generators/rails/authentication/templates/views/passwords_mailer/reset.text.erb +2 -0
- data/lib/rails/generators/rails/credentials/templates/credentials.yml.tt +4 -0
- data/lib/rails/generators/rails/db/system/change/change_generator.rb +1 -1
- data/lib/rails/generators/rails/devcontainer/devcontainer_generator.rb +5 -3
- data/lib/rails/generators/rails/devcontainer/templates/devcontainer/devcontainer.json.tt +1 -1
- data/lib/rails/generators/rails/plugin/plugin_generator.rb +11 -11
- data/lib/rails/generators/rails/plugin/templates/github/ci.yml.tt +1 -1
- data/lib/rails/generators/rails/plugin/templates/test/test_helper.rb.tt +2 -2
- data/lib/rails/generators/rails/scaffold_controller/templates/api_controller.rb.tt +2 -2
- data/lib/rails/generators/rails/scaffold_controller/templates/controller.rb.tt +3 -3
- data/lib/rails/generators/rails/script/USAGE +18 -0
- data/lib/rails/generators/rails/script/script_generator.rb +18 -0
- data/lib/rails/generators/rails/script/templates/script.rb.tt +3 -0
- data/lib/rails/generators.rb +7 -2
- data/lib/rails/info_controller.rb +10 -2
- data/lib/rails/rack/silence_request.rb +33 -0
- data/lib/rails/rack.rb +1 -0
- data/lib/rails/railtie.rb +13 -13
- data/lib/rails/source_annotation_extractor.rb +31 -14
- data/lib/rails/tasks/statistics.rake +13 -28
- data/lib/rails/templates/rails/info/notes.html.erb +65 -0
- metadata +41 -21
- data/lib/rails/generators/rails/app/templates/app/assets/config/manifest.js.tt +0 -2
- data/lib/rails/generators/rails/app/templates/app/channels/application_cable/channel.rb.tt +0 -4
- data/lib/rails/generators/rails/app/templates/app/channels/application_cable/connection.rb.tt +0 -4
- data/lib/rails/generators/rails/app/templates/config/initializers/new_framework_defaults_7_2.rb.tt +0 -70
- data/lib/rails/generators/rails/app/templates/config/initializers/permissions_policy.rb.tt +0 -13
- data/lib/rails/generators/rails/app/templates/test/channels/application_cable/connection_test.rb.tt +0 -13
- data/lib/rails/generators/rails/plugin/templates/rails/dummy_manifest.js.tt +0 -10
- data/lib/rails/generators/rails/plugin/templates/rails/engine_manifest.js.tt +0 -6
- data/lib/rails/generators/rails/plugin/templates/rails/javascripts.js.tt +0 -17
data/lib/rails/generators/rails/app/templates/config/initializers/new_framework_defaults_7_2.rb.tt
DELETED
@@ -1,70 +0,0 @@
|
|
1
|
-
# Be sure to restart your server when you modify this file.
|
2
|
-
#
|
3
|
-
# This file eases your Rails 7.2 framework defaults upgrade.
|
4
|
-
#
|
5
|
-
# Uncomment each configuration one by one to switch to the new default.
|
6
|
-
# Once your application is ready to run with all new defaults, you can remove
|
7
|
-
# this file and set the `config.load_defaults` to `7.2`.
|
8
|
-
#
|
9
|
-
# Read the Guide for Upgrading Ruby on Rails for more info on each option.
|
10
|
-
# https://guides.rubyonrails.org/upgrading_ruby_on_rails.html
|
11
|
-
|
12
|
-
###
|
13
|
-
# Controls whether Active Job's `#perform_later` and similar methods automatically defer
|
14
|
-
# the job queuing to after the current Active Record transaction is committed.
|
15
|
-
#
|
16
|
-
# Example:
|
17
|
-
# Topic.transaction do
|
18
|
-
# topic = Topic.create(...)
|
19
|
-
# NewTopicNotificationJob.perform_later(topic)
|
20
|
-
# end
|
21
|
-
#
|
22
|
-
# In this example, if the configuration is set to `:never`, the job will
|
23
|
-
# be enqueued immediately, even though the `Topic` hasn't been committed yet.
|
24
|
-
# Because of this, if the job is picked up almost immediately, or if the
|
25
|
-
# transaction doesn't succeed for some reason, the job will fail to find this
|
26
|
-
# topic in the database.
|
27
|
-
#
|
28
|
-
# If `enqueue_after_transaction_commit` is set to `:default`, the queue adapter
|
29
|
-
# will define the behaviour.
|
30
|
-
#
|
31
|
-
# Note: Active Job backends can disable this feature. This is generally done by
|
32
|
-
# backends that use the same database as Active Record as a queue, hence they
|
33
|
-
# don't need this feature.
|
34
|
-
#++
|
35
|
-
# Rails.application.config.active_job.enqueue_after_transaction_commit = :default
|
36
|
-
|
37
|
-
###
|
38
|
-
# Adds image/webp to the list of content types Active Storage considers as an image
|
39
|
-
# Prevents automatic conversion to a fallback PNG, and assumes clients support WebP, as they support gif, jpeg, and png.
|
40
|
-
# This is possible due to broad browser support for WebP, but older browsers and email clients may still not support
|
41
|
-
# WebP. Requires imagemagick/libvips built with WebP support.
|
42
|
-
#++
|
43
|
-
# Rails.application.config.active_storage.web_image_content_types = %w[image/png image/jpeg image/gif image/webp]
|
44
|
-
|
45
|
-
###
|
46
|
-
# Enable validation of migration timestamps. When set, an ActiveRecord::InvalidMigrationTimestampError
|
47
|
-
# will be raised if the timestamp prefix for a migration is more than a day ahead of the timestamp
|
48
|
-
# associated with the current time. This is done to prevent forward-dating of migration files, which can
|
49
|
-
# impact migration generation and other migration commands.
|
50
|
-
#
|
51
|
-
# Applications with existing timestamped migrations that do not adhere to the
|
52
|
-
# expected format can disable validation by setting this config to `false`.
|
53
|
-
#++
|
54
|
-
# Rails.application.config.active_record.validate_migration_timestamps = true
|
55
|
-
|
56
|
-
###
|
57
|
-
# Controls whether the PostgresqlAdapter should decode dates automatically with manual queries.
|
58
|
-
#
|
59
|
-
# Example:
|
60
|
-
# ActiveRecord::ConnectionAdapters::PostgreSQLAdapter.select_value("select '2024-01-01'::date") #=> Date
|
61
|
-
#
|
62
|
-
# This query used to return a `String`.
|
63
|
-
#++
|
64
|
-
# Rails.application.config.active_record.postgresql_adapter_decode_dates = true
|
65
|
-
|
66
|
-
###
|
67
|
-
# Enables YJIT as of Ruby 3.3, to bring sizeable performance improvements. If you are
|
68
|
-
# deploying to a memory constrained environment you may want to set this to `false`.
|
69
|
-
#++
|
70
|
-
# Rails.application.config.yjit = true
|
@@ -1,13 +0,0 @@
|
|
1
|
-
# Be sure to restart your server when you modify this file.
|
2
|
-
|
3
|
-
# Define an application-wide HTTP permissions policy. For further
|
4
|
-
# information see: https://developers.google.com/web/updates/2018/06/feature-policy
|
5
|
-
|
6
|
-
# Rails.application.config.permissions_policy do |policy|
|
7
|
-
# policy.camera :none
|
8
|
-
# policy.gyroscope :none
|
9
|
-
# policy.microphone :none
|
10
|
-
# policy.usb :none
|
11
|
-
# policy.fullscreen :self
|
12
|
-
# policy.payment :self, "https://secure.example.com"
|
13
|
-
# end
|
data/lib/rails/generators/rails/app/templates/test/channels/application_cable/connection_test.rb.tt
DELETED
@@ -1,13 +0,0 @@
|
|
1
|
-
require "test_helper"
|
2
|
-
|
3
|
-
module ApplicationCable
|
4
|
-
class ConnectionTest < ActionCable::Connection::TestCase
|
5
|
-
# test "connects with cookies" do
|
6
|
-
# cookies.signed[:user_id] = 42
|
7
|
-
#
|
8
|
-
# connect
|
9
|
-
#
|
10
|
-
# assert_equal connection.user_id, "42"
|
11
|
-
# end
|
12
|
-
end
|
13
|
-
end
|
@@ -1,10 +0,0 @@
|
|
1
|
-
<% unless api? -%>
|
2
|
-
//= link_tree ../images
|
3
|
-
<% end -%>
|
4
|
-
<% unless options.skip_javascript -%>
|
5
|
-
//= link_directory ../javascripts .js
|
6
|
-
<% end -%>
|
7
|
-
//= link_directory ../stylesheets .css
|
8
|
-
<% if mountable? && !api? -%>
|
9
|
-
//= link <%= underscored_name %>_manifest.js
|
10
|
-
<% end -%>
|
@@ -1,17 +0,0 @@
|
|
1
|
-
// This is a manifest file that'll be compiled into application.js, which will include all the files
|
2
|
-
// listed below.
|
3
|
-
//
|
4
|
-
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
|
5
|
-
// or any plugin's vendor/assets/javascripts directory can be referenced here using a relative path.
|
6
|
-
//
|
7
|
-
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
|
8
|
-
// compiled file. JavaScript code in this file should be added after the last require_* statement.
|
9
|
-
//
|
10
|
-
// Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details
|
11
|
-
// about supported directives.
|
12
|
-
//
|
13
|
-
//= require rails-ujs
|
14
|
-
<% unless skip_active_storage? -%>
|
15
|
-
//= require activestorage
|
16
|
-
<% end -%>
|
17
|
-
//= require_tree .
|