Associations have never allowed nor supported `foreign_key` option
being passed as an Array. This still holds true for Rails 7.1
However with Rails 7.1 supporting composite primary keys it may become
more common for applications to mistakenly pass an array to `foreign_key:`.
This commit adds an exception to raise when `foreign_key:` is passed as
an array.
This code was introduced by #17221 to workaround issues with not having
the `:en` locale set in the app to translate when calling `to_sentence`,
when having `I18n.enforce_available_locales` enabled.
We can still use the helper, with the defaults provided by the code,
without using I18n and thus without relying on the app locale, by
passing the `locale: false` option.
Fix: https://github.com/rails/rails/pull/49563
The semantic_logger gems doesn't behave exactly like stdlib logger
in that `SemanticLogger#level` returns a Symbol while stdlib `Logger#level`
returns an Integer.
Because of this we can't simply compare integers, we have to use the
various `#{level}?` methods.
Ref: https://github.com/rails/rails/pull/47194#issuecomment-1760334146
They both give the buffer as return value of the capture block
which confuses the `capture` helper.
Ideally we wouldn't have to check for that, but it's
an acceptable tradeoff for backward compatibility.
The downside to this is that we cannot generate ETags for these types of responses, but are assuming that by using an enumerator they don't expect a buffered response to be cacheable. This means you cannot use Enumerator to generate streaming responses.
Fixes#49588
See also: #47092
Co-authored-by: Samuel Williams <samuel.williams@oriontransfer.co.nz>
In 11a6adc4fb6172e9af081e20c5f68ca023e3bd8a custom code was added to
restrict values for some `rails new` options.
We don't need to implement this when it's already supported by Thor.
This also adds `none` as an option to the asset_pipeline as used in:
`railties/test/generators/shared_generator_tests.rb:320`.
Add email to the list of default filter parameters
Email addresses are considered personal data. While not quite on the same level of sensitivity as the other parameters in the list any application that implements signup through email without SSO inadvertently logs this information.
Otherwise they are considered separate lists instead of a sequence
within the same list. This also renders the code block with extra
indent, as part of the item they belong to.
Also use `Active Record Encryption` with capital letters consistently.
[ci skip]