Commit Graph

83639 Commits

Author SHA1 Message Date
Shane Boyer ef291097fc
fix: correct config.host_authorization reference
The Middleware `ActionDispatch::HostAuthorization` configuration documentation references `config.host_configuration`.  Correct this to `config.host_authorization` to match the source code documentation in `action_dispatch/middleware/host_authorization.rb`.
2022-04-11 00:31:27 -04:00
Jack Scotti 4d8e5f8269
Update source of `secret_key_base` in cookie rotator example
`secrets.secret_key_base` can be one of the many different places where `secret_key_base` is set and therefore it might not work with your application.
Updating the docs to use `Rails.application.secret_key_base` fixes the issue.

Rails `secret_key_base` - [docs](https://api.rubyonrails.org/classes/Rails/Application.html#method-i-secret_key_base)
2022-04-08 17:01:57 +01:00
Eugene Kenny 8f39fbe18a
Merge pull request #44860 from ghousemohamed/fix-typo-for-word-libraries
Fix typo: libaries -> libraries [ci-skip]
2022-04-08 08:51:21 +01:00
Ghouse Mohamed 18ff0f041f Fix typo: libaries -> libraries 2022-04-08 09:47:58 +05:30
eileencodes bceb73616b
Fix database selector docs
I had updated these docs in 770e12fddc when I added a generator for
this file. These docs didn't get updated in that change.
2022-04-07 11:59:19 -04:00
Eileen M. Uchitelle 4ea043331c
Merge pull request #44854 from seejohnrun/simplify-connected-to-check
Use connection_class to check in connected_to
2022-04-07 10:06:45 -04:00
Gannon McGibbon 39b7bf7a00
Merge pull request #44844 from stefkin/acp-key-validation
Only allow String and Symbol keys in ActionController::Parameters
2022-04-06 16:19:48 -04:00
John Crepezzi 3e936131ac Use connection_class to check in connected_to
Rather than check the `connection_specification_name` when determining
if we need to stop the user from calling `connected_to`, we can just
check the `connection_class?` method which should be `true` for any
class which has called `connects_to`.
2022-04-06 15:42:48 -04:00
Seva Stefkin 86980d1a9d
Only allow String and Symbol keys in ActionController::Parameters 2022-04-06 21:24:40 +02:00
Gannon McGibbon 8d791726e1 Fix style in test/core_ext/enumerable_test.rb 2022-04-06 13:21:49 -04:00
Jean Boussier 94884da8f8 Handle renaming of `global_constant_state` in Ruby 3.2
Ref: https://github.com/ruby/ruby/pull/5766
2022-04-06 09:22:00 +02:00
Ryuta Kamizono f6f59be028 Remove deprecated comparing AC::Parameters with a hash assertion
https://buildkite.com/rails/rails/builds/85809#83bae90f-f7ca-4a23-aab9-c9b71d5b823f/1167-1177
2022-04-06 16:18:36 +09:00
Jean Boussier a2e201fc6d
Merge pull request #44283 from simbasdad/csrf_token_storage
Allow CSRF tokens to be stored outside of session.
2022-04-06 09:14:56 +02:00
Ryuta Kamizono cbb46698f8
Merge pull request #44850 from kamipo/preserve_kwargs_flag
All intermediate delegation methods should preserve kwargs flag
2022-04-06 16:10:42 +09:00
Ryuta Kamizono e6486076f0
Merge pull request #44849 from ksss/drop-query-tags
Remove autoload to unused constant
2022-04-06 15:50:22 +09:00
Ryuta Kamizono 714fd07fd9 All intermediate delegation methods should preserve kwargs flag
Since 0456826180,
`foo(*caller_args)` method call delegation no longer preserve kwargs
flag.

Fixes #44846.
2022-04-06 15:32:54 +09:00
ksss fff5567803
Remove autoload to unused constant 2022-04-06 15:31:15 +09:00
Viktor Schmidt 22ca875f9c
Add docs about how to use remote browser in test (#44311)
* Add docs about how to use remote browser in test

* Update guides/source/testing.md

Co-authored-by: Lewis Buckley <lewis@lewisbuckley.co.uk>

Co-authored-by: Lewis Buckley <lewis@lewisbuckley.co.uk>
2022-04-06 01:14:41 +05:30
Vipul A M f0718971a3
Merge pull request #44592 from ghiculescu/remote-ip-docs
[docs] RemoteIp improvements
2022-04-05 15:40:33 -04:00
Vipul A M f3e176c23b
Merge pull request #44574 from NobodysNightmare/fix-activestorage-cdn-example
Fix the example for using a CDN with ActiveStorage
2022-04-05 15:39:22 -04:00
Petrik de Heus f1c079951d
Merge pull request #44783 from p8/guides/move-validates-associated
Group `validates_associated` guide with `validates_*` [ci-skip]
2022-04-05 21:38:33 +02:00
Petrik de Heus b5d3301823
Merge pull request #44830 from SkipKayhil/docs-nonce-generator
Document ETag compatible CSP nonce generator [ci skip]
2022-04-05 21:34:40 +02:00
Eileen M. Uchitelle 5c24a737ff
Merge pull request #44843 from schlubbi/schlubbi/has-many-through-transactions
Use the through_reflection class to open transactions
2022-04-05 12:40:51 -04:00
Eileen M. Uchitelle 0b02ede5fe
Merge pull request #44833 from ghousemohamed/extend-test-cases-in-ar-for-methods-accepting-blocks
Extend test cases in AR for methods accepting blocks
2022-04-05 11:38:21 -04:00
Eileen M. Uchitelle c30635877a
Merge pull request #44845 from eileencodes/fix-persistence-methods-for-readonly-records
Fix touch and update_column/s for readonly records
2022-04-05 11:31:25 -04:00
eileencodes 0c508aeb61
Fix touch and update_column/s for readonly records
The methods `touch`, `update_column`, and `update_columns` were not
raising an error when the record was readonly.

Fixes #44839
2022-04-05 10:46:53 -04:00
Stefan Jöst 1e77c846c4 Use the through_reflection class to open transactions
Co-authored-by: matthewd <matthewd@github.com>
2022-04-05 10:23:06 +02:00
Hartley McGuire f5cf908122
Document ETag compatible CSP nonce generator
The content_security_policy initializer template was updated in 40b25fd
to suggest a method compatible with conditional GET requests by default,
so this updates the security documentation to describe the difference
between the original value and the "etag compatible" value and when
they should be used.
2022-04-04 23:59:16 -04:00
Andrew Kowpak f2c66ce392
Allow CSRF tokens to be stored outside of session 2022-04-04 14:17:44 -04:00
Aaron Patterson cfa7284789
Merge pull request #44826 from stefkin/acp-eql-flag
Add a flag to disable deprecated AC::Parameters comparison
2022-04-04 09:09:44 -07:00
Eileen M. Uchitelle 313dd2e981
Merge pull request #44827 from rails/remove-legacy-connection-handling
Remove legacy_connection_handling
2022-04-04 11:10:07 -04:00
eileencodes ad52c0a197
Remove legacy_connection_handling
This functionality has been deprecated since Rails 6.1 and can now be
removed. I've deleted all code, docs, references, and tests related to
this feature.
2022-04-04 09:36:13 -04:00
Eileen M. Uchitelle ca6d15ba17
Merge pull request #44834 from ghiculescu/schema-dump-env
`rails db:schema:{dump,load}` now checks `ENV["SCHEMA_FORMAT"]` before config
2022-04-04 09:25:17 -04:00
Seva Stefkin 67762c2407
Add a flag to disable deprecated AC::Parameters comparison 2022-04-04 10:08:05 +02:00
Alex Ghiculescu d5fc7da4c3 `rails db:schema:{dump,load}` now checks `ENV["SCHEMA_FORMAT"]` before config
Since `rails db:structure:{dump,load}` was deprecated there wasn't a simple way to dump a schema to both SQL and Ruby formats. This PR implements @jeremy suggestion @ https://github.com/rails/rails/pull/39470#pullrequestreview-483599714, so you can now do this with an environment variable. For example:

```
SCHEMA_FORMAT=sql rake db:schema:dump
```
2022-04-03 19:30:52 -04:00
Ghouse Mohamed b3b781c50e Extended test cases in AR for methods accepting blocks 2022-04-03 22:52:53 +05:30
Eugene Kenny bb4a8a9188 Fix deprecation horizon for ActionController::Parameters#==
The deprecation will be released in Rails 7.1, so the behaviour won't be
removed until the version after.
2022-04-03 18:17:47 +01:00
Eugene Kenny 3ae590f543
Merge pull request #44832 from robin850/fix-removal-version
Fix next Rails version in intended removal
2022-04-03 18:11:28 +01:00
Robin Dupret 4067f564a5 Fix next Rails version in intended removal
Following-up #44728
2022-04-03 14:35:21 +02:00
Eileen M. Uchitelle 926b803297
Merge pull request #44822 from yahonda/bump_net_protocol_013
Address bug_report_templates/action_controller_gem.rb
2022-04-01 13:23:20 -04:00
Yasuo Honda dae605c764 Address bug_report_templates/action_controller_gem.rb
This commit addresses the following error.

```ruby
$ ruby -v
ruby 3.1.1p18 (2022-02-18 revision 53f5fc4236) [x86_64-linux]
$ cd guides/bug_report_templates
$ ruby action_controller_gem.rb
Fetching gem metadata from https://rubygems.org/...........
... snip ...
Fetching net-protocol 0.1.3
... snip ...
/home/yahonda/.rbenv/versions/3.1.1/lib/ruby/gems/3.1.0/gems/bundler-2.3.4/lib/bundler/runtime.rb:309:in `check_for_activated_spec!': You have already activated net-protocol 0.1.2, but your Gemfile requires net-protocol 0.1.3. Since net-protocol is a default gem, you can either remove your dependency on it or try updating to a newer version of bundler that supports net-protocol as a default gem. (Gem::LoadError)
	from /home/yahonda/.rbenv/versions/3.1.1/lib/ruby/gems/3.1.0/gems/bundler-2.3.4/lib/bundler/runtime.rb:25:in `block in setup'
	from /home/yahonda/.rbenv/versions/3.1.1/lib/ruby/gems/3.1.0/gems/bundler-2.3.4/lib/bundler/spec_set.rb:136:in `each'
	from /home/yahonda/.rbenv/versions/3.1.1/lib/ruby/gems/3.1.0/gems/bundler-2.3.4/lib/bundler/spec_set.rb:136:in `each'
	from /home/yahonda/.rbenv/versions/3.1.1/lib/ruby/gems/3.1.0/gems/bundler-2.3.4/lib/bundler/runtime.rb:24:in `map'
	from /home/yahonda/.rbenv/versions/3.1.1/lib/ruby/gems/3.1.0/gems/bundler-2.3.4/lib/bundler/runtime.rb:24:in `setup'
	from /home/yahonda/.rbenv/versions/3.1.1/lib/ruby/gems/3.1.0/gems/bundler-2.3.4/lib/bundler/inline.rb:71:in `block in gemfile'
	from /home/yahonda/.rbenv/versions/3.1.1/lib/ruby/gems/3.1.0/gems/bundler-2.3.4/lib/bundler/settings.rb:131:in `temporary'
	from /home/yahonda/.rbenv/versions/3.1.1/lib/ruby/gems/3.1.0/gems/bundler-2.3.4/lib/bundler/inline.rb:55:in `gemfile'
	from action_controller_gem.rb:5:in `<main>'
$
```

Background:

- This test fails since net-protocol 0.1.3 has been released on Apr 1, 2022
https://rubygems.org/gems/net-protocol/versions/0.1.3

- Gemfile.lock specifies `net-protocol` 0.1.2, I assume it means "You
  have already activated net-protocol 0.1.2,".

  https://buildkite.com/rails/rails/builds/85716#dec4bf21-ae22-41db-8cf6-b91ab93b31b5/140-734
  ```ruby
    net-protocol (0.1.2)
  ```

- Actually, I do not know why this `action_controller_gem.rb` only fails with Ruby
  3.0 or higher, Ruby 2.7 works fine.
2022-04-02 00:27:45 +09:00
Eileen M. Uchitelle 3b9be03933
Merge pull request #44820 from fatkodima/db_prepare-dev-exists
Fix `db:prepare` task to create/migrate test db when dev db already exists
2022-04-01 11:21:34 -04:00
fatkodima dbefed5019 Fix `db:prepare` task to create/migrate test db when dev db already exists
Fixes #44815.
2022-04-01 15:59:12 +03:00
Eileen M. Uchitelle b97c308f91
Merge pull request #44811 from pjambet/pj/improve-assert-changes-error-message
Improve default message for assert_changes
2022-04-01 08:49:18 -04:00
Eileen M. Uchitelle c32514bb39
Merge pull request #44816 from gmcgibbon/ac_params_dont_delegate_values_to_hash
Don't delegate ActionController::Parameters#values to hash
2022-04-01 08:48:26 -04:00
Eileen M. Uchitelle 388f286146
Merge pull request #44818 from jbampton/fix-word-case-of-rss
Change `rss` to `RSS` in `ImageLinkToTag`
2022-04-01 08:46:57 -04:00
Xavier Noria ee907fc38e Document a use case for autoloading in after_initialize 2022-04-01 10:12:13 +02:00
John Bampton ad91029117 Change `rss` to `RSS` in `ImageLinkToTag` 2022-04-01 12:05:28 +10:00
Gannon McGibbon 20b77321ef Fix deprecation warning in ActionController::Parameters enumerator test 2022-03-31 18:59:04 -04:00
Gannon McGibbon aba6008850 Don't delegate ActionController::Parameters#values to hash
Instead, cast any nested hashes into ActionController::Parameters.
2022-03-31 18:59:03 -04:00