Commit Graph

91952 Commits

Author SHA1 Message Date
zzak e2adebef43
Re-enable railtie non_existent sqlite3 test from #51901 2024-05-27 17:34:17 +09:00
David Heinemeier Hansson 1b3fc3c82e
Change asset pipeline default to Propshaft in Rails 8 (#51799)
* Change asset pipeline default to Propshaft

* Use :all for stylesheets when propshaft is active

* Switch to using propshaft as the default (still need to find a way to tests against sprockets too)

* Fix tests that rely on sprockets being used

* Fix Propshaft tests (#51913)

* Update railties/test/generators/shared_generator_tests.rb

Co-authored-by: Lázaro Nixon <lazaronixon@hotmail.com>

---------

Co-authored-by: Lázaro Nixon <lazaronixon@hotmail.com>
2024-05-25 20:48:35 -07:00
Petrik de Heus d0a3e18d4d
Merge pull request #51867 from duffuniverse/add-missed-comma-to-instrumentation-guide
[ci skip] Add a comma in the Exceptions section of Active Support Instrumentation guide
2024-05-25 23:29:21 +02:00
Xavier Noria 4cde578c0e Restore original header for browser version guards 2024-05-25 19:27:30 +02:00
Ryuta Kamizono f114a247aa
Merge pull request #51915 from nisusam/fix_symbol
Fix `+` symbol [ci skip]
2024-05-25 18:01:14 +09:00
nisusam 9622342950 Fix `+` symbol [ci skip] 2024-05-25 14:22:49 +05:30
Xavier Noria 0a9d844c9a Remove backticks from jemalloc
jemalloc is the name of a project.
2024-05-25 09:42:38 +02:00
Xavier Noria 91f9d640bd Edit pass over the 7.2 release notes 2024-05-25 09:33:58 +02:00
Rafael Mendonça França bb3da8726b
Draft of the release notes 2024-05-24 20:42:13 +00:00
Rafael Mendonça França 3ccca0cc54
Merge pull request #51121 from jamiemccarthy/jm-fix-allow-browser-versions
Fix AllowBrowser versions
2024-05-24 16:27:14 -04:00
Rafael Mendonça França fe4617fd7e
Merge pull request #51912 from Earlopain/aj-priority
Document what higher/lower priority numbers mean in ActiveJob guide [ci skip]
2024-05-24 16:26:52 -04:00
Rafael Mendonça França 548be67bce
Merge pull request #51911 from silva96/patch-2
Fix association_basics.md
2024-05-24 16:25:30 -04:00
Earlopain 2e8c0de787
Document what higher/lower priority numbers mean in ActiveJob guide
Or rather, what they could mean. What to do with priority numbers is up to the adapter implementation.

All adapters that support priority that I know of treat lower priority as more urgent:
* Backburner
* Delayed Job
* Que
* SolidQueue
* GoodJob (in v4)
2024-05-24 22:12:06 +02:00
Benjamín Silva 25b238568c
Fix association_basics.md
In this section the relation was renamed `:writer` so we need to reflect that in the examples.
2024-05-24 16:10:22 -04:00
Rafael Mendonça França ad41f711ce
Merge pull request #51846 from simi/base64-standard-error
Catch StandardError during Base64 decoding in message encryptor.
2024-05-24 16:00:43 -04:00
Jamie McCarthy dc34e293e0
ActionPack: fix BrowserBlocker versions
css-nesting is not fully supported until Chrome 120, Opera 106:
https://caniuse.com/css-nesting
https://developer.mozilla.org/en-US/docs/Web/CSS/Nesting_selector#browser_compatibility
2024-05-24 19:50:05 +00:00
Rafael Mendonça França cff6b2cd8d
Merge pull request #51874 from stiig/fix-colspan-for-rails-routes
Fix colspan for representing search results in the rails routes
2024-05-24 15:47:05 -04:00
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 e97db3b395, reversing
changes made to a27a1751cf.

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