Commit Graph

7118 Commits

Author SHA1 Message Date
Carlos Antonio da Silva e63f8205d1 Tweak AR Encryption guide for better highlighting [ci skip] 2021-04-02 11:04:28 -03:00
Ryuta Kamizono 1251703c4d Fix typo [ci skip] 2021-04-02 14:38:00 +09:00
Sampat Badhe 2032daa415
Fix typos encryption doc (#41817)
* fix typo

[ci skip]
2021-04-02 14:24:43 +09:00
Jorge Manrubia 3648c25cad Minor encryption guide tweaks and corrections 2021-04-01 14:52:42 -07:00
Jeremy Daer 07c3eee478
Merge pull request #41659 from basecamp/active-record-encryption
Add encryption to Active Record
2021-04-01 14:14:38 -07:00
Guillermo Iguaran 3583d82ea2
Merge pull request #41812 from rokbot/fix/guides-mailer-basics
[ci skip] fix on guides mailer_basics avoid ActiveModel::ForbiddenAttributesError
2021-04-01 13:26:30 -07:00
Jorge Manrubia e24fb5524a Validate that proper keys are configured when declaring attributes
This enables to disable deterministic encryption by just not setting
deterministic_key.
2021-04-01 18:20:54 +02:00
Jorge Manrubia 575a2c6ce0 Fix credential typo in Guide 2021-04-01 15:07:12 +02:00
Jorge Manrubia fd91dac6f4 Add note about action text 2021-04-01 15:02:15 +02:00
Jorge Manrubia f78a480818 Encourage deterministic encryption to remain unchanged
This implements several changes to encourage deterministic encryption to
remain unchanged. The main motivation is letting you define unique
indexes on deterministically-encrypted columns:

- By default, deterministic encryption will always use the oldest
encryption scheme to encrypt new data, when there are many.
- You can skip this default behavior and make it always use the current
encryption scheme with:

```ruby
deterministic: { fixed: false } # using this should be a rare need
```

- Deterministic encryption still supports previous encryption schemes
normally. So they will be used to add additional values to queries, for
example.
- You can't rotate deterministic encryption keys anymore. We can add
support for that in the future.

This makes for reasonable defaults:

- People using "deterministic: true" will get unique indexes working out
of the box.
- The system will encourage keeping deterministic encryption stable:
  - By always using oldest encryption schemes
  - By forbidding configuring multiple keys

But you can still opt-out of the default if you need to.
2021-04-01 15:02:15 +02:00
Jorge Manrubia 7a1fb99302 Add support to declare previous encryption schemes globally 2021-04-01 15:02:15 +02:00
Jorge Manrubia 28145c3cee Rename master_key => primary_key 2021-04-01 15:02:15 +02:00
Jorge Manrubia fd3fbcc4eb Update guides/source/active_record_encryption.md
Co-authored-by: Connor Shea <connor.james.shea@gmail.com>
2021-04-01 15:02:15 +02:00
Jorge Manrubia 212543deb5 Update guide 2021-04-01 15:02:14 +02:00
Jorge Manrubia 209e62c938 Update guide 2021-04-01 15:02:14 +02:00
Jorge Manrubia 4e1f66f90b Add config options 2021-04-01 15:02:14 +02:00
Jorge Manrubia 795b1c654a Allow list explicit list of allowed properties
The alternative is more brittle
2021-04-01 15:02:14 +02:00
Jorge Manrubia 9aca274042 Encryption guide (WIP) 2021-04-01 15:02:13 +02:00
Brian Buchalter 6be9c498bc Provide context when logging unpermitted parameters
Currently, the payload of the unpermitted_parameters.action_controller
events emitted by StrongParameters does not provide enough information for
developers to understand which controller and action received the
unpermitted parameters. This PR modifies ActionController::Parameters to
allow callers to specify a "context" which is included in the logging
payload.

*Implementation Strategy*
Since the ActionController::Parameters class is only loosely coupled
with controllers and can technically be used in any context, this PR
expects the caller to provide logging context.

Since StrongParameters is caller in Rails and has access to the
request object I chose to provide a payload similar to the
start_processing.action_controller event.
2021-03-31 17:15:23 -06:00
Roderick Bompart 2d4006aece fix on guides mailer_basics avoid ActiveModel::ForbiddenAttributesError 2021-03-31 10:51:10 -04:00
Rafael França e9268f73aa
Merge pull request #41791 from benkoshy/update-action-mailbox-documentation
Add: link to documentation [ci-skip]
2021-03-30 23:10:14 -04:00
BK 178b22f970 Add: link to documentation
Update guides/source/action_mailbox_basics.md

Co-authored-by: Rafael França <rafael@franca.dev>
2021-03-31 10:33:03 +11:00
Alex Ghiculescu b9dfa21fbd
Document `config.require_master_key` [docs] [ci-skip] 2021-03-29 10:57:29 -05:00
Ryuta Kamizono af4ca424eb Follow up to #41765 [ci skip] 2021-03-28 10:55:35 +09:00
Jason Barnabe 345384fb1f
Specifiy association :validate option only applies to new associated objects
Per [code comments](6daa2d8315/activerecord/lib/active_record/associations.rb (L1418-L1420)), the `:validate` option only makes a difference for *new* objects. Existing objects are not validated, regardless of the setting.
2021-03-25 15:04:45 -05:00
Takumasa Ochi 9131f08904
[ci skip] Fix Grammatical Errors and Eliminate Ambiguous Wordings in Multiple Database Documents (#41670)
* Improve Readability of Guides on Multiple Databases

* Add comma after the introductory clause.
* Add backtick for the symbols used in the program.
  * `primary`
  * `false`
* Add descriptive information on ambiguous words.
  * users => database users
  * use the first configuration => use the first configuration as default
  * a recent write => a recent write by the requesting user
  * for an environment => for each environment
  * both a `role` and `shard` => both a `role` and a `shard`
* Add missing period at the end of a sentence.

* Add double quote inside backtick

[Rafael Mendonça França + Takumasa Ochi]
2021-03-24 23:36:20 -04:00
Cory Gwin 96b3d5a026
Document Destroy Async (#41680)
* Document Destroy Async
Motivation:
  - Add docs for Destroy async. I think I probably need to add
    information about setting up active job, but I am not sure where we
    want this, so I am putting this together to start conversation.

Related Issues:
  - #41093

* Active Job not ActiveJob

* Fix some spelling issues

[Cory Gwin, Rafael Mendonça França, Eileen M. Uchitelle, Henrik Nyh]
2021-03-24 00:54:50 -04:00
Rafael França 419b0785b3
Merge pull request #41725 from okuramasafumi/add-more-examples-to-routes-shallow-doc
[skip-ci] Add table for shallow routing to routing doc
2021-03-24 00:49:47 -04:00
Alexandre Barret 7a0cb3d239 Fix SQL result of `Book.joins(reviews: :customer)` query example 2021-03-24 09:09:11 +13:00
Ryuta Kamizono 2f29b643f7 Merge pull request #41736 from lairtonmendes/6-1-stable
remove unecessary sufix

[ci skip]
2021-03-23 11:01:10 +09:00
Ryuta Kamizono ee0420ffcc
Merge pull request #41731 from henrik/typo-rel
Fix typo in 6.1 release notes

[ci skip]
2021-03-23 08:24:29 +09:00
Henrik Nyh 959266998f Fix typo in 6.1 release notes 2021-03-22 21:15:17 +00:00
OKURA Masafumi d2bbb218cb Add table for shallow routing to routing doc
Shallow routes is one of the most difficult-to-use features for
generating routes in Rails.
To make it easier to understand how it works, a routing table
shows us the final result and really helps.
However, there's only one table for shallow routes and it's with
shallow_path option, which is even more complicated.
Adding a table for simpler shallow routes will help people
understand shallow routing's idea and usage better.

There's a drawback of this addition. Adding a large table occupies
the screen and might make it slightly difficult to walk through
the documentation.
2021-03-22 22:25:54 +09:00
OKURA Masafumi 0dd7654032 Remove some references to OrderedHash
OrderedHash is deprecated but there are some requires and references
to OrderedHash, which might be confusing.
As described in
https://github.com/rails/rails/issues/22681#issuecomment-166059717
OrderedHash is internal only so references in the docs should be
removed.
2021-03-22 21:14:32 +09:00
Xavier Noria 6d38553b09 Removes the monkey-patch for Marshal.load
Marshal.load autoloads out of the box with Zeitwerk. See

    https://github.com/fxn/zeitwerk/blob/master/test/lib/zeitwerk/test_marshal.rb

for similar coverage.
2021-03-18 22:08:25 +01:00
Gannon McGibbon f55e596ac6
Merge pull request #41524 from robotfelix/clarify_bug_fix_to_security_fix_policy
[ci skip] Clarify maintenance policy for bug fixes to security patches
2021-03-12 16:45:28 -05:00
Felix Kenton e192fdddcf Clarify maintenance policy for bug fixes to security patches
The policy for security patches is very strict, and some people may find it surprising that even breaking changes as a result of an oversight or bug in a security fix will neither receive a release of their own nor be included in any subsequent security patches to address other security issues. Hopefully this additional text will help clarify this and avoid confusion.
2021-03-12 21:26:44 +00:00
Alex Ghiculescu 0fba70c082 Clarify when `enctype="multipart/form-data"` gets added to forms [docs]
As noted in https://github.com/rails/rails/issues/41632 the docs for this are incorrect. The `enctype` attribute is automatically added anytime you make a form with a `file_field`.

Resolves https://github.com/rails/rails/issues/41632

Update actionview/lib/action_view/helpers/form_helper.rb

Co-authored-by: Petrik de Heus <petrik@deheus.net>
2021-03-10 13:09:46 -06:00
ryu39 0bbc293b77
Fix database.yml example in multiple databases Rails Guide
* Change :user to :username
* Add :password
2021-03-10 10:44:12 -05:00
Eileen M. Uchitelle 7240fb636b
Merge pull request #41560 from dmilburn/add-rails-development-hosts-env-variable
Add RAILS_DEVELOPMENT_HOSTS env variable
2021-03-10 10:34:44 -05:00
Xavier Noria 0f6a033798 Replaces references to internal AS::Dependencies attributes in the AS guide 2021-03-10 08:12:25 +01:00
Xavier Noria 482e081aaa Deletes AS::Dependencies.warnings_on_first_load 2021-03-10 07:55:29 +01:00
Debbie Milburn 03aa08526a
Merge branch 'main' into add-rails-development-hosts-env-variable 2021-03-09 11:59:11 -05:00
Ryuta Kamizono dc96825d44 Fix `number_to_human_size`'s result [ci skip] 2021-03-09 08:45:35 +09:00
Xavier Noria 0d523d8365 Drops support for classic mode
This starts a series of patches in which we drop classic mode. The final
result no longer has a const_missing callback, there is no hook/unhook,
and so on.

So, in this patch we remove the ability of configuring classic, but some
of the code that remains will be further refactored.
2021-03-08 05:30:11 +01:00
Henrik Nyh 1c97c5b2c2
Autoloading docs: Grammar/style tweaks 2021-03-07 11:38:42 -05:00
Mark VanLandingham bece535c98
Add config.action_text.attachment_tag_name 2021-03-05 16:57:36 -05:00
Debbie Milburn 8c50571808 Add RAILS_DEVELOPMENT_HOSTS to allow adding authorized hosts for development
Co-authored-by: Josh Abernathy <joshaber@gmail.com>

Update railties/CHANGELOG.md

Co-authored-by: Gannon McGibbon <gannon@hey.com>

Update railties/lib/rails/application/configuration.rb

Co-authored-by: Gannon McGibbon <gannon@hey.com>

Use yield block to safely alter env variables

Remove trailing whitespace

Update railties/CHANGELOG.md wording

Co-authored-by: Marivaldo Cavalheiro <marivaldo@gmail.com>

Have comma separated list ignore spaces

Add missing comma
2021-03-05 14:03:37 -05:00
Christian Schmidt 6cd184ff0f
Use image/jpeg instead of non-standard image/jpg 2021-03-05 13:14:11 -05:00
Jonathan Hefner 2addbaf2e6
Merge pull request #41623 from NatMorcos/patch-2
[ci skip] Fix typos and grammatical errors in autoloading guide
2021-03-05 10:42:45 -06:00