Commit Graph

87792 Commits

Author SHA1 Message Date
Rafael Mendonça França
6bb8bd3091
Merge pull request #48323 from Eric-Guo/ci_fixture_vendor_no_loading
Exclude the vendor as including vendor will cause CI break after merge #48287
2023-05-30 16:02:02 -04:00
Rafael Mendonça França
54de0cb2ee
Merge pull request #48293 from flavorjones/flavorjones-support-html5-sanitizer
Update Action View to use HTML5 standards-compliant sanitizers
2023-05-30 16:00:13 -04:00
Jean Boussier
ae02cd6539
Merge pull request #48322 from fatkodima/fix-locking-with-counter-caches
Fix decrementing counter caches for parent records using optimistic locking
2023-05-30 09:45:56 +02:00
zzak
96f3c101f1
Merge pull request #48340 from zzak/ar-query-methods-api-docs
Fixes for AR::QueryMethods API docs
2023-05-30 13:49:31 +09:00
zzak
dd9f3ff64a
Fix headings for AR::QueryMethods#where
* Use capital case for headings
* Escape String, Hash, Array, Module from RDoc autolinking
2023-05-30 13:45:46 +09:00
zzak
8a3e5d2448
Fixed-width font fixes for AR::QueryMethods 2023-05-30 13:44:54 +09:00
Eric-Guo
368c65ab7e
Exclude the vendor folder otherwise will cause CI break, example:
coreui-pro-rails-starter/vendor/ruby/3.0.0/bundler/gems/rails-a23ca7dcacdc/activerecord/lib/active_record/fixtures.rb:574:in `create_fixtures'

https://github.com/rails/rails/pull/48287#issuecomment-1563170637
2023-05-30 10:48:04 +08:00
zzak
b899c378f5
Merge pull request #48337 from zzak/ar-associations-api-fixes
Several AR::Associations API doc fixes
2023-05-30 11:08:53 +09:00
zzak
bc7a727c6d
Remove AR::Associations::Preloader from public API doc
This removes the following previously internal API:

* AR::Associations::Preloader
* AR::Associations::Preloader::Association
* AR::Associations::Preloader::Association::LoaderQuery
* AR::Associations::Preloader::Association::LoaderRecords

Because there was a `:nodoc:` on both Preloader and Preloader::Association,
the assumption is that everything underthat is also private.

However, RDoc did not do the right thing.
2023-05-30 10:55:31 +09:00
zzak
8bcea6b07a
Link to the first method in the public instance methods list for AR::Associations 2023-05-30 10:54:56 +09:00
zzak
cfed245164
Link to AR::QueryMethods#includes for associations option in AR::Associations::Preloader.new 2023-05-30 10:52:16 +09:00
zzak
0677321b2a
Unlink Callbacks heading from AR::AutosaveAssociation 2023-05-30 10:51:01 +09:00
fatkodima
a7dc348406 Fix decrementing counter caches for parent records using optimistic locking 2023-05-30 02:17:37 +03:00
Guillermo Iguaran
1db475d1a6
Merge pull request #48335 from northeastprince/link-console1984-in-ARE-guide
Link console1984 where mentioned in ARE guide
2023-05-29 14:13:19 -07:00
Matt Almeida
b02bfa14bf
Link console1984 where mentioned in ARE guide 2023-05-29 14:02:31 -04:00
Matthew Draper
7d1c4dd7be
Merge pull request #48297 from matthewd/binary-cast-changes-encoding
Ensure binary-destined values have binary encoding during type cast
2023-05-29 20:40:11 +09:30
zzak
80b682301a
Merge pull request #48333 from zzak/ar-db-config-docs
💅 Several fixes to AR::DatabaseConfigurations docs
2023-05-29 19:14:39 +09:00
zzak
e0ae39b33f
💅 Several fixes to AR::DatabaseConfigurations docs
* Fix RDoc autolinks where it makes sense
* Fixed-width font for database_tasks option
* Remove duplicate "Also aliased as blank?"
* Link to AR::DatabaseConfigurations from config classes
* Link to AR::Base.configurations from DatabaseConfigurations
* Move options doc to initializer
2023-05-29 19:10:02 +09:00
Matthew Draper
308dd9c504 Ensure binary-destined values have binary encoding during type cast 2023-05-29 18:21:20 +09:30
Jean Boussier
d381d249d7
Merge pull request #48321 from moofkit/fix-sentinels-config-with-strings-arguments
Fix ActionCable Redis configuration with sentinels
2023-05-29 09:55:31 +02:00
zzak
c77e46072a
Merge pull request #48332 from zzak/ac-metal-middleware
Add a tiny more detail about the middleware stack
2023-05-29 16:51:48 +09:00
zzak
95ec9ca09f
💅 Follow #48329 for API index page 2023-05-29 16:51:06 +09:00
zzak
7a014c07e2
Add a tiny more detail about the middleware stack 2023-05-29 16:43:34 +09:00
zzak
e68732ed0d
Merge pull request #48331 from zzak/ac-metal-autolinks
Fix RDoc autolinks in ActionController::Metal
2023-05-29 16:10:15 +09:00
zzak
2b637b6850
Fix RDoc autolinks in ActionController::Metal 2023-05-29 16:01:00 +09:00
zzak
b34db46c06
Merge pull request #48329 from zzak/unlink-rails-lib-readme
Unlink Rails constant from READMEs
2023-05-29 15:18:41 +09:00
zzak
722d4f6582
Unlink Rails constant from READMEs 2023-05-29 15:14:44 +09:00
zzak
1b973f6180
Merge pull request #48327 from zzak/action-controller-links
Fix links for Renderers.add and Renderers.remove
2023-05-29 14:30:52 +09:00
zzak
7765a693ee
Fix links for Renderers.add and Renderers.remove 2023-05-29 14:24:10 +09:00
zzak
294be7c7de
Merge pull request #48325 from zzak/am-api-links
Fix linking on ActiveModel::API
2023-05-29 12:47:42 +09:00
zzak
d7d24b02c1
Fix linking on ActiveModel::API 2023-05-29 12:40:48 +09:00
zzak
7496cfea56
Merge pull request #48324 from zzak/ar-core-values_at
Trick RDoc to pickup ActiveRecord::Core#values_at
2023-05-29 10:56:04 +09:00
zzak
3b1f1580ab
Trick RDoc to pickup ActiveRecord::Core#values_at 2023-05-29 10:36:27 +09:00
Mike Dalessio
ce43ac6088
Add support for HTML5 sanitizers
* new config value: action_view.sanitizer_vendor
* SanitizerHelper defaults to Rails::HTML4::Sanitizer
* 7.1 config defaults to Rails::HTML5::Sanitizer if it's supported
2023-05-28 14:00:35 -04:00
Mike Dalessio
500ccaaeea
Update dependency on rails-html-sanitizer to ~>1.6
for HTML5 sanitizer support
2023-05-28 14:00:35 -04:00
Mike Dalessio
8000f4e633
Overhaul SanitizerHelper tests
to avoid testing specific sanitizations and instead:

- unit test SanitizeHelper using a mock vendor and mock sanitizers
- integration test support vendors

Note that we only have one supported vendor today --
Rails::Html::Sanitizer -- but this commit helps prepare the codebase
so we can add another, Rails::HTML5::Sanitizer.

The upstream vendor, rails-html-sanitizer, is adequately testing the
sanitization behavior expected by Rails and so this commit removes all
but the most basic expectations for each sanitizer type.
2023-05-28 14:00:27 -04:00
Mike Dalessio
18dd733c01
Add sanitizer_vendor accessor to ActionView SanitizeHelper 2023-05-28 13:54:32 -04:00
Dmitriy Ivliev
f1ace63973 Fix ActionCable Redis configuration with sentinels
This commit resolves an integration bug between ActionCable and Redis >= 5.0 when using sentinels configuration.
The issue arises from the fact that the sentinels configuration is a nested array of hashes, while the Redis client expects keys to be symbols.
This fix modifies the preparation of the Redis configuration to ensure that all keys are represented as symbols.
2023-05-28 11:57:23 +00:00
Guillermo Iguaran
e9ea600c24
Merge pull request #48312 from skipkayhil/hm-document-at-rich-text
Add doc for FormBuilder#rich_text_area [ci skip]
2023-05-27 22:51:52 -07:00
Rafael Mendonça França
d6004a34d3
Merge pull request #48315 from flavorjones/flavorjones-remove-coupled-rhs-tests
Remove Action View Sanitizer Helper tests asserting on allowed tags and attributes
2023-05-27 23:28:23 -04:00
Mike Dalessio
ae8afc821c
Remove tests asserting on allowed tags and attributes
Equivalent tests exist upstream in rails-html-sanitizer, and leaving
these here mean our tests are coupled to r-h-s and are liable to break
as the allowlists evolve.
2023-05-26 19:55:57 -04:00
Hartley McGuire
c7a812535d
Add doc for FormBuilder#rich_text_area
Using the style of other ActionView::Helpers::FormBuilder methods that
delegate to another method.
2023-05-26 18:24:14 -04:00
zzak
6609914748
Merge pull request #48311 from zzak/am-error-title
Fix heading for StrictValidationFailed
2023-05-27 07:02:07 +09:00
zzak
8674d53cd0
Fix heading for StrictValidationFailed 2023-05-27 06:56:26 +09:00
Guillermo Iguaran
c49bd00a4a
Merge pull request #48303 from ryanhertz/transaction-after-commit
fix after_commit callback when record is destroyed twice
2023-05-26 11:00:57 -07:00
Yasuo Honda
3fff522549
Merge pull request #48309 from fatkodima/fix-sqlite3-preserve-default-function
Preserve existing column default functions when altering table in SQLite
2023-05-26 23:23:17 +09:00
fatkodima
4e0079f09a Preserve existing column default functions when altering table in SQLite 2023-05-26 14:09:52 +03:00
Rafael Mendonça França
54ec908a2d
Merge pull request #47940 from fatkodima/fix-alias-where-missing
Remove table alias added when using `where.missing` or `where.associated`
2023-05-25 23:04:37 -04:00
Jonathan Hefner
79448371f7
Merge pull request #48302 from jonathanhefner/memory_store-marshal-once
Avoid double marshal with `MemoryStore::DupCoder`
2023-05-25 16:58:21 -05:00
Ryan Hertz
e8ae4ecd5c
fix after_commit callback when record is destroyed twice
When `destroy` is called twice on a persisted record inside a
transaction, the after_commit callbacks fail to run. The second
time `destroy` is called, `@_trigger_destroy_callback` is set to false
because the record has already been deleted, even though the
transaction hasn't completed yet, and the after_commit callbacks haven't
had a chance to run from the first `destroy`.
2023-05-25 14:58:02 -07:00