forked from rails/rails
-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Introduce markdownlint for guides #5
Closed
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
71271d8
to
cf67c1e
Compare
Background: When creating active storage variants, `ActiveStorage::VariantRecord` is inserted, then a file is uploaded. Because upload can be failed, the file can be missing even though `ActiveStorage::VariantRecord` exists. When a file is missing, we need to delete the corresponding `ActiveStorage::VariantRecord` but there's no API to delete just one variant e.g., `blob.variant(resize_to_limit: [100, 100]).destroy`. Co-authored-by: Yuichiro NAKAGAWA <ii.hsif.drows@gmail.com> Co-authored-by: Ryohei UEDA <ueda@anipos.co.jp>
By default, exclude constraints in PostgreSQL are checked after each statement. This works for most use cases, but becomes a major limitation when replacing records with overlapping ranges by using multiple statements. ```ruby exclusion_constraint :users, "daterange(valid_from, valid_to) WITH &&", deferrable: :immediate ``` Passing `deferrable: :immediate` checks constraint after each statement, but allows manually deferring the check using `SET CONSTRAINTS ALL DEFERRED` within a transaction. This will cause the excludes to be checked after the transaction. It's also possible to change the default behavior from an immediate check (after the statement), to a deferred check (after the transaction): ```ruby exclusion_constraint :users, "daterange(valid_from, valid_to) WITH &&", deferrable: :deferred ``` *Hiroyuki Ishii*
… task otherwise, if a gem appends to the constant, we can end up with an error.
Multiple fixture paths can now be specified using the `#fixture_paths` accessor.
The codepaths related to destroying associations asynchronously now consider when query constraints are present. In most cases, this means interpreting the primary key as an array of columns, and identifying associated records by a tuple of these columns, where previously this would've been a single ID. In each of the callsites, we use branching. This is done to maintain backwards compatibility and ensure the signature of the destroy job remains stable: it has consumers outside of Rails.
…nstraint Adds support for deferrable exclude constraints in PostgreSQL.
794bd7d
to
dadf46d
Compare
The version check [added][1] is for 3.3.13, but the CHANGELOG specifies 3.3.16 [1]: 7da3353
…-version Fix rubygems version mentioned in CHANGELOG
active_model/forbidden_attributes_protection is not used since rails#10776
Currently we use both Thor and Rake for `bin/rails` commands. We eventually want to get all the built-ins task promoted to Thor Commands. This migrates the `restart` task to Thor. With this change it also possible to restart outside the application directory: ```bash blog/bin/rails restart ``` Co-authored-by: Hartley McGuire <skipkayhil@gmail.com> Co-authored-by: Jonathan Hefner <jonathan@hefner.pro>
…e-keys Destroying associations asynchronously respect query constraints
…pk values `ActiveRecord::FinderMethods#find` now supports passing sets of composite primary key values like: ```ruby Cpk::Book.find([1, 1]) Cpk::Book.find([[1, 1]]) Cpk::Book.find([1, 1], [1, 2]) Cpk::Book.find([[1, 1], [1, 2]]) ``` and treats values as values of the composite primary key columns but only for models with the `primary_key` being an `Array`.
Initial implementation falls back to `primary_key.is_a?(Array)` so it can be immediately used in place of direct `is_a?` checks. Though implementation may be changed to rely on a pre-initialized `@composite_primary_key` ivar in the future.
…ier-in-find Extend `ActiveRecord::FinderMethods#find` with support for composite pk values
…trings Revert "Quote binary strings in Arel"
Use Thor for built-in restart task
Given a model with a composite primary key like: `TravelRoute.primary_key = [:from, :to]` Calling `TravelRoute.ids` would return an array of identifiers which is represented by an array of arrays: ```ruby TravelRoute.all.ids # => [["Ottawa", "New York"], ["London", "Paris"]] ```
`Listen.to` starts a bunch of background threads that need to perform some work before they are able to receive events, but it doesn't block until they are ready, which expose us to a race condition. With `wait_for_state(:processing_events)` we can ensure that it's ready on Linux, however on macOS, the Darwin backend has a second background thread we can't wait on. As a workaround we wait a bit after the fork to allow that thread to reach it's listning state.
…ociation-from-a-non-query-constraints-model Fix precedence of `primary_key:` in associations with `query_constraints`
…-cpk-model Fix `ActiveRecord::Calculations#ids` for a composite primary key model
…It is deprecated, but it should still return a string until it is removed. So, if multiple fixture_paths are configured, it just returns the first path.
…of-deprecated-fixture-path-method `TestFixtures#fixture_path` should return a single path
Fix actionpack CHANGELOG lint error
…-hook Add `ActiveSupport` load hook for `ActionText::EncryptedRichText`
implement `provider_job_id` for Backburner jobs
…arset Set charset in content type response headers (OWASP)
Rubocop markdown snippets
Bring String#truncate* docs in line with signatures
move directory existence check for code statistics task inside of the…
…e-partial Allow Attachables to override default template when attachment is missing
Use indentation for dividing sections in USAGE files
…d-file-update-checker Fix race condition in evented file update checker
Update recommended Node.js dev deps guide
Add a note about installing dev deps on debian linux
This is a follow up to rails#47186, this time for all markdown content. [markdownlint](https://github.com/markdownlint/markdownlint) is an excellent tool, and I've found it very useful for finding issues in the guides. Many of the rules are common style issues I'm correcting on PRs, so it will be nice to have that automated. We should also be able to use the same config with our editors, so that errors show up in real-time 🙏 and will update the contributing docs once this gets merged with how to debug and use mdl appropriately.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a follow up to rails#47186, this time for all markdown content.
markdownlint is an excellent tool, and I've found it very useful for finding issues in the guides.
Many of the rules are common style issues I'm correcting on PRs, so it will be nice to have that automated.
We should also be able to use the same config with our editors, so that errors show up in real-time 🙏 and will update the contributing docs once this gets merged with how to debug and use
mdl
appropriately.