Commit Graph

9085 Commits

Author SHA1 Message Date
fatkodima
a87668a238 Support :source_location tag option for query log tags 2024-02-06 00:52:57 +02:00
Akhil G Krishnan
e8786601ec Remove codespell from contribution guide 2024-02-05 23:49:11 +05:30
Carlos Antonio da Silva
979c6b0366 Fix broken anchor in Rails Guides Guidelines
Use american english word as per the guidelines
[ci skip]
2024-01-30 11:01:56 -03:00
Petrik de Heus
1cb5b8d5a9
Merge pull request #50881 from D-system/doc-no-extension-in-filename-render
Update caching_with_rails.md regarding extension in filename [ci skip]
2024-01-30 10:17:39 +01:00
Thomas Brennetot
db3d29442c Doc: update partial rendering with dots in name
Since #39164 extension are deprecated (shipped with Rails 6.1).
And has been removed in Rails 7.0.
2024-01-30 09:32:41 +09:00
Yutaka Kamei
329582353c
Add ".[key]" to the abstract namespaces [ci skip] (#50860)
* Add ".[key]" to the abstract namespaces [ci skip]

The section "Error Message Scopes" describes how the Rails look up the
namespaces for a validation error message with code snippets.
The first code snippet shows abstract namespaces like
`errors.attributes.[attribute_name]` while the second one demonstrates
the materialized one like `errors.attributes.name.blank`.
The first code snippet lacks the validation error "key." My team member
was confused and created a translation without "key", so I think it
would be helpful to add ".[key]" to the abstract namespaces.

* Move abstract key list after :blank examples

Co-authored-by: Rafael Mendonça França <rafael@rubyonrails.org>
2024-01-29 17:45:55 -05:00
Rafael Mendonça França
e7073e4c95
Merge pull request #50887 from marvin-bitterlich/marvin.bitterlich/result-set
Add row_count field to sql.active_record notification
2024-01-29 13:02:16 -05:00
Nikita Vasilevsky
574f54b465
Remove stolen data prices from the security guide 2024-01-29 13:19:23 +00:00
Xavier Noria
d823faa67b Remove add_autoload_paths_to_load_path docs from autoloading guide 2024-01-28 18:05:58 +01:00
Petrik de Heus
56fd69e9bc
Merge pull request #50697 from avanderpluijm/patch-1
docs: improve runner documentation [ci skip]
2024-01-28 15:51:41 +01:00
Marvin Bitterlich
e9a2288c13
Add row_count field to sql.active_record notification
This field returns the amount of rows returned by the query that emitted the notification.    
This metric is useful in cases where one wants to detect queries with big result sets.
2024-01-27 00:12:19 +00:00
Rafael Mendonça França
c6bd547ee8
Merge pull request #50864 from seanpdoyle/strict-loading-documentation
Mention Strict Locals in more documentation
2024-01-25 16:01:17 -05:00
Petrik de Heus
2edbf50218
Merge pull request #50851 from notapatch/pr-guides-active-record-querying-update
Update Guides: AR querying english text to match code behavior [ci-skip]
2024-01-25 20:27:15 +01:00
Sean Doyle
6e1c2f7fbf Mention Strict Locals in more documentation
Motivation / Background
---

Strict Locals support was introduced in [#45727][] and announced as part
of the [7.1 Release][]. There are several mentions across the Guides,
but support is rarely mentioned in the API documentation.

Detail
----

Mention the template short identifier (the pathname, in most cases) as
part of the `ArgumentError` message.

This commit adds two test cases to ensure support for splatting
additional arguments, and for forbidding block and positional arguments.

It also makes mention of strict locals in more places, and links to the
guides.

[#45727]: https://github.com/rails/rails/pull/45727
[7.1 Release]: https://edgeguides.rubyonrails.org/7_1_release_notes.html#allow-templates-to-set-strict-locals
2024-01-25 10:14:44 -05:00
Edouard CHIN
39b0692851
Merge pull request #50817 from joshuay03/add-queue-with-priority-to-activejob-docs
[Docs] Add section on Queue Priority to `ActiveJob` docs
2024-01-25 15:32:09 +01:00
Joshua Young
9691cf675f Add section on Queue Priority to ActiveJob docs 2024-01-24 21:28:23 +10:00
notapatch
addf281ddc Update Guides: AR querying english text to match code behavior
The code: Book.joins(:author, :reviews)

This code will return books that have an author and at least 1
review.

English text implies it returns the book and the author:

"return all books with their author .."

Changing the text to imply it returns books with an author.
2024-01-23 13:01:18 +00:00
Kyle Voytovich
458f2c1c45
Fix the CreateProducts migration file name in the docs 2024-01-20 10:12:23 -05:00
tanaken0515
024d0abdec
fix: Entry#entryable_types to Entry.entryable_types 2024-01-20 16:26:01 +09:00
Arn van der Pluijm
f3de8b698d
Update guides/source/command_line.md
Co-authored-by: Petrik de Heus <petrik@deheus.net>
2024-01-19 11:18:04 +01:00
Jonathan Hefner
c8bfd6870d
Merge pull request #50799 from jonathanhefner/command-fix-task-list-when-no-default-task
Fix `bin/rails -T` when no default task is defined
2024-01-18 18:43:18 -06:00
Eugene Kenny
36cc7c560b Remove unsupported values for config.action_dispatch.show_exceptions [ci skip]
Support for `true` and `false` was removed in
ec2c2666c255029593dda2f78e89b457cf8509fc.
2024-01-19 00:21:26 +00:00
Jonathan Hefner
f21e4299d6 Fix bin/rails -T when no default task is defined
When Rake parses an argument string with no tasks, it sets the top-level
task as "default".  Prior to this commit, if no default task was defined
(for example, if an app was generated with `--skip-test` and didn't
define its own default task), `Rails::Command::RakeCommand` would raise
`UnrecognizedCommandError`, preventing Rake from displaying the task
list.

This commit changes `Rails::Command::RakeCommand` to let Rake handle the
"default" task.

Fixes #50700.
2024-01-18 18:10:44 -06:00
Yasuo Honda
2fb05958a6
Merge pull request #50756 from Angy-h/getting-started-update-screenshot
Update the screenshot in the section 8.4 of Getting Started with Rails [ci skip]
2024-01-17 18:11:47 +09:00
JP Rosevear
b3fecab5c0
Merge branch 'main' into feature/delegated-type-types-introspection 2024-01-15 12:46:59 -05:00
Annaheim.h@gmail.com
bd934475b9 [docs] Update Screenshot in "Getting Started with Rails"
Replace the existing screenshot with the output produced in Rails 7. The current screenshot
seems to be captured in a previous version.
2024-01-15 18:43:26 +09:00
Arn van der Pluijm
da3648bc1d
Update command_line.md
Make it more clear that the Rails runner is run within the Rails application. Without the word `application` it's unclear what the Rails context is.
2024-01-10 16:49:57 +01:00
Jean Boussier
2b776fad28
Merge pull request #50664 from ghiculescu/global_executor_concurrency-example
Add an example to the `global_executor_concurrency` docs
2024-01-10 08:51:16 +01:00
Sean Doyle
723e69c857 Document developer-facing change to config.action_dispatch.show_exceptions default
Support for the new `action_dispatch.show_exceptions` values was
introduced in [e28f147][]. Alongside the change to introduce new values
(like `:all`, `:rescuable`, `:none`), the default behavior was changed
for `Rails.env.test?`.

Prior to that commit, the `test` environment's default value was `false`
(introduced in [d898a4b][]) (which corresponds to the new `:none`
setting).

The new default behavior has some unintended negative side effects that
impact the feedback loop at the core of test-driven development.
When errors are rescued and transformed into HTML pages, the context of
the cause of failure is obscured by additional layers of information.

First, this commit adds more prominent entries to the Upgrading and
Configuring guides, as well as the 7.1 Release Notes to document the
details of the configuration and its new values.

Next, this commit adds more documentation around the change in default
behavior. To start, it mentions the new value in the sections for the
affected test types: Controller, Integration, and System.

[e28f147]: e28f147329
[d898a4b]: d898a4ba42
2024-01-09 18:08:28 -05:00
Petrik
64b24171c4 Add code examples to readonly documentation 2024-01-09 21:22:10 +01:00
Alex Ghiculescu
a40bb8eb8f Expand on global_executor_concurrency docs 2024-01-09 16:03:54 +10:00
JP Rosevear
e323d3f81c Define a class method to introspect valid delegatable types so they can
be used to validate the type column and power strong parameters.
2024-01-08 20:47:16 -05:00
Rafael Mendonça França
84f773f9d1
Merge pull request #50622 from seanpdoyle/document-render-in-examples
Document rendering `:renderable` and `#render_in`
2024-01-08 16:51:39 -05:00
Petrik de Heus
0b04c15147
Merge pull request #50593 from p8/guides/add-english-and-oxford-comma-to-wording
Move "English" and "Oxford Comma" sections under "Wording" [ci-skip]
2024-01-08 19:04:47 +01:00
Igor Alexandrov
ef84e8a949 Removed references to separate test case templates due to the fact, that these templates were merged. 2024-01-08 15:32:31 +04:00
Petrik de Heus
0c9d50b9b5
Merge pull request #50635 from ghiculescu/connection-pool-docs
Minor improvements to Connection Pool docs
2024-01-08 09:56:49 +01:00
Alex
b04c512776 Minor improvements to Connection Pool docs 2024-01-08 09:59:30 +10:00
Jean Boussier
9090ec2c84
Merge pull request #50612 from sato11/use-the-article-an-for-sql
Use the article "an" for "SQL"
2024-01-07 21:11:17 +01:00
Hartley McGuire
7f341134ca
Merge pull request #50631 from skipkayhil/hm-link-bundler-io
Update link for creating a gem [ci-skip]
2024-01-07 12:48:40 -05:00
Hartley McGuire
22c79cb464
Update link for creating a gem
[The old link points to this new page][1]

[1]: eaaf139b44
2024-01-07 12:38:55 -05:00
Hartley McGuire
580e1d621a
Fix links to master branches renamed to main
We recently had [two][1] [PRs][2] to update these types of links, so
this commit does all of the rest (remaining links to master branches
were checked and still exist).

[1]: e76c52a939dd7312fb9fd22b08e13496dc5c961e
[2]: a2ed3437e3be1e4dee4d1dac3c51a3b8742044ff
2024-01-07 12:35:46 -05:00
Jonathan Hefner
e0ae03895e Fix typo [ci-skip]
Follow-up to #50342.
2024-01-06 18:07:26 -06:00
Jonathan Hefner
5ec67e6d49 Use separate code blocks for separate files [ci-skip]
Follow-up to #50342.
2024-01-06 18:07:26 -06:00
Sean Doyle
4117583e4b Document rendering :renderable and #render_in
Provide examples for rendering objects that respond to `render_in`. Also
highlight that the object can also define a `#format` method to control
how the rendered String should be treated.

Add test coverage for both Action View's and Action Pack's support for
`render` with `:renderable` options.
2024-01-06 17:57:02 -05:00
Junichi Sato
b109e1f90f
Use the article "an" for "SQL"
Since the documentation guidelines favor it:
https://guides.rubyonrails.org/api_documentation_guidelines.html.

> Use the article "an" for "SQL", as in "an SQL statement". Also "an SQLite database".
2024-01-06 15:28:58 +09:00
Junichi Sato
d66b6a7bf1
Replace typo "enging" with "engine" [ci-skip] 2024-01-06 10:14:55 +09:00
Max Veytsman
a7cd42496b
Update api_app.md to remove specific app name 2024-01-05 13:34:18 -05:00
maximerety
d0f3b007b2
[Fix #48685] Make the encryptor agnostic of the type of data to decrypt
It is the role of the underlying serializer to accept or reject the data
to decrypt depending on its type. This behavior mirrors what is done at
encryption, where the serializer asserts that the input is an
ActiveRecord::Encryption::Message.

This change allows for a wider variety of custom serializers, but does
not change the behavior when using the default MessageSerializer class.
Indeed, the default message serializer will raise a TypeError when
invoking JSON.parse on any non-String input. This error will subsequently
be translated into an ActiveRecord::Encryption::Errors::Encoding error
by the encryptor, which does not change the current behavior at the
encryptor level.

A new test asserts that the default MessageSerializer is able to reject
unexpected data types on its own at decryption time, just as it does at
encryption time (test already present). The test also asserts that an
exception is translated into an ActiveRecord::Encryption::Error::Encoding
error at the encryptor level.
2024-01-05 13:05:15 -05:00
Rafael Mendonça França
8c4af05a38
Merge pull request #50591 from akhilgkrishnan/add-nonce-stylesheet-link-tag
Add the nonce: true option for stylesheet_link_tag helper
2024-01-05 10:29:13 -05:00
Rafael Mendonça França
442d4b86ce
Merge pull request #50595 from p8/guides/api-docs-wording-examples
Add "GOOD" and "BAD" examples to API wording guide [ci-skip]
2024-01-05 10:27:58 -05:00