2024-01-20 20:45:16 +00:00
* Rails console now indicates application name and the current Rails environment:
2024-01-18 21:58:56 +00:00
```txt
2024-01-20 20:45:16 +00:00
my-app(dev)> # for RAILS_ENV=development
my-app(test)> # for RAILS_ENV=test
my-app(prod)> # for RAILS_ENV=production
my-app(my_env)> # for RAILS_ENV=my_env
2024-01-18 21:58:56 +00:00
```
2024-01-20 20:45:16 +00:00
The application name is derived from the application's module name from `config/application.rb` .
For example, `MyApp` will displayed as `my-app` in the prompt.
Additionally, the environment name will be colorized when the environment is
2024-01-23 18:04:32 +00:00
`development` (blue), `test` (blue), or `production` (red), if your
2024-01-18 21:58:56 +00:00
terminal supports it.
*Stan Lo*
2024-01-18 19:34:12 +00:00
* `bin/rails` now prints its help message when given an unrecognized bare
option.
__Before__
```console
$ bin/rails -v
Rails 7.2.0.alpha
$ bin/rails -V
rake, version 13.0.6
$ bin/rails -s
Running 0 tests in a single process (parallelization threshold is 50)
...
$ bin/rails -S
invalid option: -S
```
__After__
```console
$ bin/rails -v
Rails 7.2.0.alpha
$ bin/rails -V
Usage:
bin/rails COMMAND [options]
You must specify a command. The most common commands are:
...
$ bin/rails -s
Usage:
bin/rails COMMAND [options]
You must specify a command. The most common commands are:
...
$ bin/rails -S
Usage:
bin/rails COMMAND [options]
You must specify a command. The most common commands are:
...
```
*Jonathan Hefner*
2024-01-16 19:39:04 +00:00
* Ensure `autoload_paths` , `autoload_once_paths` , `eager_load_paths` , and
`load_paths` only have directories when initialized from engine defaults.
Previously, files under the `app` directory could end up there too.
2024-01-12 08:43:06 +00:00
*Takumasa Ochi*
2024-01-11 11:59:33 +00:00
* Prevent unnecessary application reloads in development.
Previously, some files outside autoload paths triggered unnecessary reloads.
With this fix, application reloads according to `Rails.autoloaders.main.dirs` ,
thereby preventing unnecessary reloads.
*Takumasa Ochi*
2024-01-16 19:39:04 +00:00
* Use `oven-sh/setup-bun` in GitHub CI when generating an app with Bun.
2024-01-08 02:15:55 +00:00
*TangRufus*
2024-01-16 19:39:04 +00:00
* Disable `pidfile` generation in the `production` environment.
2024-01-08 19:47:25 +00:00
*Hans Schnedlitz*
2024-01-16 19:39:04 +00:00
* Set `config.action_view.annotate_rendered_view_with_filenames` to `true` in
the `development` environment.
2023-12-27 09:49:43 +00:00
*Adrian Marin*
2024-01-16 19:39:04 +00:00
* Support the `BACKTRACE` environment variable to turn off backtrace cleaning.
2024-01-03 21:01:22 +00:00
Useful for debugging framework code:
```sh
2024-01-16 19:39:04 +00:00
BACKTRACE=1 bin/rails server
2024-01-03 21:01:22 +00:00
```
*Alex Ghiculescu*
2024-01-16 19:39:04 +00:00
* Raise `ArgumentError` when reading `config.x.something` with arguments:
2023-11-14 00:20:21 +00:00
```ruby
config.x.this_works.this_raises true # raises ArgumentError
```
*Sean Doyle*
2024-01-16 19:39:04 +00:00
* Add default PWA files for manifest and service-worker that are served from `app/views/pwa` and can be dynamically rendered through ERB. Mount these files explicitly at the root with default routes in the generated routes file.
2024-01-03 12:07:12 +00:00
*DHH*
2024-01-01 04:05:54 +00:00
* Updated system tests to now use headless Chrome by default for the new applications.
*DHH*
2024-01-16 19:39:04 +00:00
* Add GitHub CI files for Dependabot, Brakeman, RuboCop, and running tests by default. Can be skipped with `--skip-ci` .
2023-12-31 23:37:12 +00:00
*DHH*
2024-01-16 19:39:04 +00:00
* Add Brakeman by default for static analysis of security vulnerabilities. Allow skipping with `--skip-brakeman option` .
2023-12-31 18:09:47 +00:00
*vipulnsward*
2024-01-16 19:39:04 +00:00
* Add RuboCop with rules from `rubocop-rails-omakase` by default. Skip with `--skip-rubocop` .
2023-12-30 20:13:13 +00:00
*DHH* and *zzak*
2024-01-16 19:39:04 +00:00
* Use `bin/rails runner --skip-executor` to not wrap the runner script with an
Executor.
2023-11-30 20:16:40 +00:00
*Ben Sheldon*
2023-12-02 18:06:53 +00:00
* Fix isolated engines to take `ActiveRecord::Base.table_name_prefix` into consideration.
This will allow for engine defined models, such as inside Active Storage, to respect
Active Record table name prefix configuration.
*Chedli Bourguiba*
2024-01-16 19:39:04 +00:00
* Fix running `db:system:change` when the app has no Dockerfile.
2023-11-09 15:49:19 +00:00
*Hartley McGuire*
2023-10-27 06:17:36 +00:00
* In Action Mailer previews, list inline attachments separately from normal
attachments. For example, attachments that were previously listed like
> Attachments: logo.png file1.pdf file2.pdf
will now be listed like
> Attachments: file1.pdf file2.pdf (Inline: logo.png)
*Christian Schmidt* and *Jonathan Hefner*
2023-07-21 16:57:41 +00:00
* In mailer preview, only show SMTP-To if it differs from the union of To, Cc and Bcc.
*Christian Schmidt*
2024-01-16 19:39:04 +00:00
* Enable YJIT by default on new applications running Ruby 3.3+.
2023-11-07 08:00:49 +00:00
2023-11-07 09:31:09 +00:00
Adds a `config/initializers/enable_yjit.rb` initializer that enables YJIT
2023-11-07 08:00:49 +00:00
when running on Ruby 3.3+.
*Jean Boussier*
2023-10-26 01:25:26 +00:00
* In Action Mailer previews, show date from message `Date` header if present.
*Sampat Badhe*
2023-10-15 07:08:17 +00:00
* Exit with non-zero status when the migration generator fails.
*Katsuhiko YOSHIDA*
2023-10-31 07:54:13 +00:00
* Use numeric UID and GID in Dockerfile template
The Dockerfile generated by `rails new` sets the default user and group
2024-01-16 19:39:04 +00:00
by name instead of UID:GID. This can cause the following error in Kubernetes:
2023-11-03 09:30:43 +00:00
2023-10-31 07:54:13 +00:00
```
container has runAsNonRoot and image has non-numeric user (rails), cannot verify user is non-root
```
2023-11-03 09:30:43 +00:00
2023-10-31 07:54:13 +00:00
This change sets default user and group by their numeric values.
*Ivan Fedotov*
2023-10-12 17:40:09 +00:00
* Disallow invalid values for rails new options.
2024-01-16 19:39:04 +00:00
The `--database` , `--asset-pipeline` , `--css` , and `--javascript` options
for `rails new` take different arguments. This change validates them.
2023-10-12 17:40:09 +00:00
*Tony Drake* , *Akhil G Krishnan* , *Petrik de Heus*
2024-01-16 19:39:04 +00:00
* Conditionally print `$stdout` when invoking `run_generator` .
2023-10-03 11:01:16 +00:00
In an effort to improve the developer experience when debugging
generator tests, we add the ability to conditionally print `$stdout`
instead of capturing it.
This allows for calls to `binding.irb` and `puts` work as expected.
```sh
RAILS_LOG_TO_STDOUT=true ./bin/test test/generators/actions_test.rb
```
*Steve Polito*
2023-09-27 03:08:31 +00:00
2023-10-30 13:17:19 +00:00
* Remove the option `config.public_file_server.enabled` from the generators
for all environments, as the value is the same in all environments.
*Adrian Hirt*
2023-09-27 03:59:11 +00:00
Please check [7-1-stable ](https://github.com/rails/rails/blob/7-1-stable/railties/CHANGELOG.md ) for previous changes.