Commit Graph

91784 Commits

Author SHA1 Message Date
Rafael Mendonça França
5345b04c7a
Merge pull request #51904 from akhilgkrishnan/add-railties-notable-changes-release-note--7-2
Add Railties notable changes in 7.2 release note [ci skip]
2024-05-24 14:40:10 -04:00
Akhil G Krishnan
1c0fa2f542 Add Railties notable changes in 7.2 release note 2024-05-24 23:50:30 +05:30
Carlos Antonio da Silva
942be52465 Use the railties deprecator instead of creating a new one
Add tests to verify the app and helpers files deprecation / backwards
compatibility, and remove the `.rb` extension from the message, since we
generally require without them.
2024-05-24 15:19:13 -03:00
Carlos Antonio da Silva
46cd9f7406
Merge pull request #51839 from Shopify/keep-deprecated-files
Add app.rb and helpers.rb back for backward compatibility
2024-05-24 15:04:24 -03:00
Carlos Antonio da Silva
8150212b78
Merge pull request #51907 from higher-pixels/no-doc-preview-image-needed
Mark `preview_image_needed_before_processing_variants?` as private API
2024-05-24 13:18:27 -03:00
Tom Rossi
5192f31001 Mark preview_image_needed_before_processing_variants? as private API
It looks like `preview_image_needed_before_processing_variants?` was added recently,
but it's stated as being public API.

However, it looks like it's more of an implementation detail that's not meant for Active Storage users.

So this marks it as nodoc, so we're not on the hook for maintaining it.
2024-05-24 15:09:15 +00:00
eileencodes
d189cbcb56
Revert "Merge pull request #51614 from gmcgibbon/defer_route_drawing"
This reverts commit e97db3b3957781c781a61fb01265feb2b57688bb, reversing
changes made to a27a1751cfd499f69499e943f12e3400b55a323e.

This is breaking application routes when running without eager load enabled.
2024-05-24 09:59:41 -04:00
Florin Oltean
b5207ec558 Fix styling. 2024-05-24 09:22:25 +02:00
Vasiliy Matyushin
48d7feaebd fix colspan for HtmlTableFormatter and dynamic search for routes 2024-05-24 11:49:36 +05:00
Jean Boussier
272aa3bd15
Merge pull request #51898 from flavorjones/51699-improve-store-accessor-for 2024-05-24 08:34:42 +02:00
Rafael Mendonça França
6fcba444a5
Merge pull request #51900 from zzak/csrf-nodoc
Private methods do not need :nodoc: to be private API
2024-05-23 23:42:37 -04:00
Rafael Mendonça França
13252f000c
Merge pull request #51899 from zzak/bump-rdoc
Use released version of RDoc v6.7.0
2024-05-23 23:34:56 -04:00
Yasuo Honda
21bbf5aeef
Merge pull request #51901 from zzak/sqlite-non_existent-errors
Fix railtie config test for sqlite 3.46.0
2024-05-24 08:01:11 +09:00
zzak
c30c5d77d9
Fix railtie config test for sqlite 3.46.0
Follow up to #51891

This resolves the following test failure:
https://buildkite.com/rails/rails/builds/107520#018fa76e-0408-4630-a75d-eac5caa16463/1199-1209

```
Failure:
ApplicationTests::ConfigurationTest#test_SQLite3Adapter.strict_strings_by_default_can_be_configured_via_config.active_record.sqlite3_adapter_strict_strings_by_default_in_an_initializer [test/application/configuration_test.rb:2896]:
Expected /no such column: non_existent/ to match "SQLite3::SQLException: no such column: \"non_existent\" - should this be a string literal in single-quotes?".
```

Co-authored-by: Mike Dalessio <mike.dalessio@gmail.com>
2024-05-24 07:15:20 +09:00
zzak
a0621e5946
Private methods do not need :nodoc: to be private API
Follow up to #51279

Co-authored-by: Gabriel Amaral <1706819+gabriel-amaral@users.noreply.github.com>
2024-05-24 06:56:19 +09:00
zzak
467e8fe124
Use released version of RDoc v6.7.0
Follow up to #51876

Co-authored-by: Hartley McGuire <skipkayhil@gmail.com>
2024-05-24 06:46:19 +09:00
Stan Lo
0b18caccf2
Add app.rb and helpers.rb back
Those files were removed in #51760, but gems like `console1984` depend
on these files for legacy Rails console command extensions.
So keeping files around is required for backward-compatibility.
2024-05-24 06:24:50 +09:00
Rafael Mendonça França
213bdfe470
Use the --devcontainer option when generating a new Rails app in the guide 2024-05-23 21:12:16 +00:00
Carlos Antonio da Silva
be2ecdf26d
Merge pull request #51893 from indigotechtutorials/main
Fix the Direct Upload class example in Active Storage Docs [ci skip]
2024-05-23 17:14:09 -03:00
Mike Dalessio
2bf7e25243
Raise a descriptive error when a store column is misconfigured
If a developer has neglected to use a structured column type (hstore
or json) or to declare a serializer with `ActiveRecord.store`:

```ruby
  class User < ActiveRecord::Base
    store_accessor :settings, :notifications
  end
```

then a `ConfigurationError` will now be raised with a descriptive
error message when the accessor is read or written:

```ruby
  puts user.notifications
  # ActiveRecord::ConfigurationError: the column 'settings' has not
  # been configured as a store.  Please make sure the column is
  # declared serializable via 'ActiveRecord.store' or, if your
  # database supports it, use a structured column type like hstore or
  # json.
```

Previously, in this situation, a `NoMethodError` was raised when the
accessor was read or written:

```ruby
  puts user.notifications
  # NoMethodError: undefined method `accessor' for an instance of ActiveRecord::Type::Text
```

Raising a descriptive exception should help developers understand more
quickly what's wrong and how to fix it.

Closes #51699
2024-05-23 15:59:56 -04:00
Rafael Mendonça França
b284f8b867
Merge pull request #51896 from rails/rm-make-invert-opt-in
Don't enable automatically_invert_plural_associations by default
2024-05-23 15:49:51 -04:00
Rafael Mendonça França
15381dd3b1
Merge pull request #51894 from rails/rm-enable-yjit
Move plumbing to enable yjit to inside the framework
2024-05-23 15:19:39 -04:00
Rafael Mendonça França
a8a848d76e
Don't enable automatically_invert_plural_associations by default
This can cause a lot of issues that are hard to detect.

It is better to make this opt-in for people that want to use it.

In Rails 8 we can revisit if we want to enable this config by default.
2024-05-23 19:15:01 +00:00
Rafael Mendonça França
62501c78a6
Merge pull request #51880 from Shopify/devcontainer-generator
Make devcontainers opt in and create a devcontainer command
2024-05-23 15:01:50 -04:00
Rafael Mendonça França
30e6a197df
Move plumbing to enable yjit to inside the framework
There is no reason to expose all those details to users and this
has the benefit that now are can ensure that the YJIT is enabled
after all initialization is done.
2024-05-23 19:01:29 +00:00
Andrew Novoselac
df203b2e90
Create a devcontainer command
This command boots the application, and generates a Dev Container setup based on the current configuration of the application.
2024-05-23 18:50:51 +00:00
Andrew Novoselac
4d62ea3ed4
Update database.yml from DevcontainerGenerator
Postgresql's database.yml has devcontainer specific logic that should only appear when the app has a devcontainer. We need the DevcontainerGenerator to update database.yml, so when it is called by the devcontainer command the database.yml will have the right configuration.

This commit also fixes db:system:change to make sure it updates the database.yml with the correct devcontainer configuration.
2024-05-23 18:43:22 +00:00
Andrew Novoselac
1275e93594
Update application_system_test_case.rb from DevcontainerGenerator
Instead of relying on the template to be dev container aware and generate the correct configuration, let's just update the configuration in place when running the DevcontainerGenerator. This will allow the devcontainer command to update this file with the configuration needed for devcontainers without overwriting the entire file.
2024-05-23 18:43:21 +00:00
Andrew Novoselac
f31b6f02ea
Extract Dev Container implementation into its own generator
This refactoring prepares the way to implement a devcontainer command to add an devcontainer to an existing app.
2024-05-23 18:43:20 +00:00
Andrew Novoselac
a61bfe49a5
Make devcontainer opt-in when creating a new application
For Rails 7.2 we will make devcontainer and opt-in feature for new applications. When creating a new app, you can generate a devcontainer by passing the --devcontainer flag.
2024-05-23 18:43:19 +00:00
Andy Waite
a8fdfffe18
Look up route from requirements (#51850)
* Lookup route from requirements

* Add docs

* Strings instead of symbols

S

* Update actionpack/lib/action_dispatch/routing/route_set.rb

Co-authored-by: Rafael Mendonça França <rafael@franca.dev>

* Update actionpack/lib/action_dispatch/routing/route_set.rb

Co-authored-by: Rafael Mendonça França <rafael@franca.dev>

* Update actionpack/lib/action_dispatch/routing/route_set.rb

Co-authored-by: Rafael Mendonça França <rafael@franca.dev>

* Update actionpack/lib/action_dispatch/routing/route_set.rb

Co-authored-by: Rafael Mendonça França <rafael@franca.dev>

---------

Co-authored-by: Andy Waite <andyw8@users.noreply.github.com>
Co-authored-by: Rafael Mendonça França <rafael@franca.dev>
2024-05-23 11:37:45 -07:00
Rafael Mendonça França
c906f75282
Merge pull request #51822 from excid3/plugin-github-actions
Add rubocop and GitHub Actions to plugin generator
2024-05-23 14:08:58 -04:00
Rafael Mendonça França
4febb0677f
Merge pull request #51888 from Earlopain/revert-rubocop-workaround
Revert RuboCop workaround
2024-05-23 13:56:44 -04:00
Rafael Mendonça França
37227c7bbd
Merge pull request #51885 from tnir/tn-remove-webpack-from-deps
chore: remove webpack from yarn dependencies in Rails dev
2024-05-23 13:53:51 -04:00
Indigo Tech
3855416df8 fix the direct upload class example 2024-05-23 11:54:46 -05:00
Rafael Mendonça França
43e4916483
Merge pull request #51891 from flavorjones/flavorjones-update-sqlite3-test-messages
update sqlite3 adapter tests to accept error messages from v3.46.0
2024-05-23 12:26:05 -04:00
Takuya Noguchi
a5ae420c34
chore: remove webpack from yarn dependencies in Rails dev
This dependency was originally introduced in PR 33079 in
Rails 6.0 (2018).

Follows up PR 43172, which replaced webpacker 6 with
jsbundling-rails in Rails 7.0 (2021).

Signed-off-by: Takuya Noguchi <takninnovationresearch@gmail.com>
2024-05-23 16:25:00 +00:00
Rafael Mendonça França
8ea62041ae
Merge pull request #51866 from tnir/tn-update-eslint-from-4.3.0-to-8.40.0
chore(deps-dev): update eslint from 4.19.1 to 8.40.0
2024-05-23 12:23:12 -04:00
Rafael Mendonça França
97cc321280
Point to the right executable when warning about --profile 2024-05-23 16:19:53 +00:00
Rafael Mendonça França
7ee34d9efb
Enable Rails minitest plugin in our rake tasks 2024-05-23 16:16:37 +00:00
Florin Oltean
372d327b91 Make pretty_print behave more similar to inspect. 2024-05-23 18:11:13 +02:00
Rafael Mendonça França
fd6c266266
Merge pull request #51890 from tnir/tn-update-pg-in-brewfile
chore: update Brewfile per renaming postgresql Formula
2024-05-23 12:04:02 -04:00
Mike Dalessio
b2660d6f45
update sqlite3 adapter tests to accept error messages from v3.46.0
Upstream sqlite updated the error messages to be more descriptive
starting in v3.46.0. Where the error message might look like this in
earlier versions:

    no such column: non_existent

in 3.46.0 it looks like:

    no such column: "non_existent" - should this be a string literal in single-quotes?

The tests have been updated to accept either style of message.

The sqlite3-ruby gem will release a version with this vendored version
shortly, see https://github.com/sparklemotion/sqlite3-ruby/pull/536
2024-05-23 11:50:52 -04:00
Takuya Noguchi
27cb8c618c chore: update Brewfile per renaming postgresql Formula
postgresql was renamed to postgresql@14 in the Homebrew upstream
and now postgresql@16 is the latest stable, so we can use
postgresql@16 in the development environment.

cf.
8060df9169

Signed-off-by: Takuya Noguchi <takninnovationresearch@gmail.com>
2024-05-23 13:47:57 +00:00
Earlopain
720c7d14dd
Revert RuboCop workaround
Was done in 3e08223ece75ab47a17459f9696ce1ebca68ffa5 to work around a RuboCop bug.
The newest version has this fixed.
2024-05-23 14:56:53 +02:00
zzak
95a6729de8
Merge pull request #51886 from zzak/revert-51184
Revert "Merge pull request #51184 from ConfusedVorlon/document_after_commit_deduplication"
2024-05-23 20:51:37 +09:00
zzak
d4150ab5cb
Revert "Merge pull request #51184 from ConfusedVorlon/document_after_commit_deduplication"
This reverts commit 2abee307fe622939f005e9dd9a6925df0dd7ec4c, reversing
changes made to e34a0eec38767920e04f56a7aa7978b7c5fb685a.

A warning on each method is excessive and the warning should already be covered under the guide:
https://edgeguides.rubyonrails.org/active_record_callbacks.html#transaction-callbacks
2024-05-23 20:09:09 +09:00
Takuya Noguchi
b6e49a7b1f chore(deps-dev): update eslint from 4.3.0 to 8.40.0
Also update eslint-plugin-import from 2.27.5 to 2.29.0.

Signed-off-by: Takuya Noguchi <takninnovationresearch@gmail.com>
2024-05-23 14:23:15 +09:00
Rafael Mendonça França
cacb8475a9
Merge pull request #51721 from joshuay03/fix-same-association-name-as-demodularized-model-name
[Fix #51720] Infer association klass as top level if model has same demodularized name
2024-05-22 19:46:14 -04:00
Joshua Young
0516eafda2 [Fix #51720] Infer association klass as top level if model has same demodularized name 2024-05-23 08:04:57 +09:00