Commit Graph

9254 Commits

Author SHA1 Message Date
Sean Doyle 01502fe239 Remove Upgrade Guidance 2024-02-14 20:41:08 -05:00
Carlos Antonio da Silva bbdb23dcd6
Merge pull request #51064 from mkasberg/debugging-guide
Fix typo in Debugging Guide [ci skip]
2024-02-14 15:44:00 -03:00
Ridhwana a4253311d8
[RF DOCS] Review Action Text guide [ci-skip] (#50977)
Review and improve Action Text guide:

- More detailed installation steps
- Explain generated files a bit
- Improved examples
- More information around customizing the HTML/CSS
- Expand information about attachments

Co-authored-by: Carlos Antonio da Silva <carlosantoniodasilva@gmail.com>
2024-02-14 15:07:35 -03:00
bhumi1102 a8002e4604
[RF DOCS] Review Action Mailbox guide [ci-skip] (#50973)
Review and improve Action Mailbox guide, with some sections added/improved:

- Installation steps
- Processing Incoming Email - more of a step by step of the flow
- Mail object and it's fields
- List of Inbound Email 'status' values
- Routing and Incineration

Co-authored-by: Carlos Antonio da Silva <carlosantoniodasilva@gmail.com>
2024-02-14 15:02:15 -03:00
Mike Kasberg 72410ffc49 Fix typo in Debugging Guide [ciskip]
While I was reading the Debugging Rails Applications guide, this typo
threw me off and I had to re-read it to understand the intended meaning,
so it seems like it's worth fixing.

And after digging in a little more, rewording the `path` example can add
some clarity.
2024-02-13 13:35:07 -07:00
lsglucas ca73646b4a fix: outdated cors initializer docs 2024-02-10 13:30:00 -03:00
Xavier Noria 5876939a5a Update 7.0 release notes re inflections and the once autoloader 2024-02-10 12:42:40 +01:00
Rafael Mendonça França f0adde935e
Fix configuration order 2024-02-09 23:50:00 +00:00
Lewis Buckley f3e3f82e7d
Add WebP as a new framework default image type
Follows https://github.com/rails/rails/pull/38918 and
https://github.com/rails/rails/pull/38988

At the time, webp browser support was limited. Now 96% of browsers
support webp: https://caniuse.com/?search=webp
2024-02-09 23:44:51 +00:00
Rafael Mendonça França 1352bd79aa
Merge pull request #49897 from glaucocustodio/main
add a note on the postgres limit [ci skip]
2024-02-09 17:53:40 -05:00
Aji Slater 380094920a
Disambiguate language around when code stops re: `redirect_to`
This paragraph tends to cause confustion with Rails developers who have just learned the correct control flow of `redirect_to` and `render`.

A phrase above it in the "Avoiding Double Render Errors" section clears up a common misunderstanding that `render` will stop execution within a controller action. That misunderstanding is further corrected with the following phrase.

> But this will _not_ stop the rest of the code in the `show` action from running

This section is often enough to get the point across for newer developers who might often be running into double render errors, but soon after the phrase which attempts the same illustration of `redirect_to`'s execution confuses the matter by using the same language as the earlier statement to mean the opposite.

> Sometimes inexperienced developers think of `redirect_to` as a sort of `goto` command, moving execution from one place to another in your Rails code. This is _not_ correct. Your code stops running and waits for a new request from the browser.

Here "Your code stops running" means that the action will run to completion and not jump to another site in controller code. This often re-confuses the concept they've just learned and undermines their understanding. By being more specific in the second phrase, we can reinforce the concept instead.
2024-02-09 13:43:37 -06:00
Hartley McGuire d127335670
Merge pull request #50199 from apoorv1316/improve-action-view-helper-guide
Improve action view helpers guide [ci skip]

Co-authored-by: Adrianna Chang <adrianna.chang@shopify.com>
2024-02-09 00:10:37 -05:00
Hartley McGuire 282d112cd8
Add some missing Oxford Commas [ci-skip]
Co-authored-by: Apoorv Tiwari <tiwari.apoorv1316@gmail.com>
2024-02-09 00:06:20 -05:00
Carlos Antonio da Silva 1007cc8c03
Merge pull request #50988 from p8/guides/improve-dom-id-uniqueness
Improve `dom_id` uniqueness in guides
2024-02-08 15:38:10 -03:00
Petrik a720480a0a Improve `dom_id` uniqueness in guides
All headers in a guide get a unique `dom_id` to make anchor links work.
If a header is already present we would prefix it with the `dom_id` of
the parent node. This would not work for headers without parent nodes.

This commit simplifies the `dom_id` uniqueness by only prepending the
parent node if it exists. This can still result in duplicates at the
same level, but for these we already show a warning:

    *** DUPLICATE ID: 'some_id', please make sure that there are no
    headings with the same name at the same level.

Co-authored-by: Carlos Antonio da Silva <carlosantoniodasilva@gmail.com>
2024-02-08 19:18:58 +01:00
Adrianna Chang 06b7e345af
Add `active_record.config.validate_migration_timestamps` config option.
When set, an `ActiveRecord::InvalidMigrationTimestampError` will be raised if the timestamp
prefix for a migration is more than a day ahead of the timestamp associated with the current time.
This is done to prevent forward-dating of migration files, which can impact migration generation
and other migration commands.

It is turned off by default, but will be turned on for applications starting in Rails 7.2.
2024-02-08 12:14:26 -05:00
Glauco Custódio 686763e1e5 add a note on the postgres limit 2024-02-08 16:47:21 +00:00
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
ec2c2666c2.
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]: e76c52a939
[2]: a2ed3437e3
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
Petrik de Heus 082ffa9ddf
Merge pull request #50342 from JohnAnon9771/doc/improve-controlling-association-scope
doc(active_record): adding more examples about scope control
2024-01-05 15:52:27 +01:00
Petrik de Heus 26ec5e5ed0
Merge pull request #50301 from p8/guides/ror-security-links
Remove some outdated security advice from Security guide [ci-skip]
2024-01-05 15:49:39 +01:00
Petrik 34629a9007 Add "GOOD" and "BAD" examples to API wording guide [ci-skip]
This makes it easier to scan examples.
2024-01-05 14:01:53 +01:00
Petrik ff97ba71b7 Move "English" and "Oxford Comma" sections under "Wording" [ci-skip]
The "English" and "Oxford Comma" sections currently have 1 or 2
sentences, which makes it difficult to justify their own top sections.

Moving the "English" section under the "Wording" section makes sense, as
we already have a "Naming" section. We can rename it to "American
English" for easier scanability.
As the "Wording" section also mentions punctuation, we can move the
"Oxford Comma" section there as well.
2024-01-05 12:41:50 +01:00
Petrik de Heus 1702b6cbfd
Merge pull request #50592 from p8/guides/expand-wording
Add Naming and Pronouns headings to API wording guide [ci-skip]
2024-01-05 12:25:50 +01:00
Petrik d1ccf34ad1 Add Naming and Pronouns headings to API wording guide [ci-skip]
This groups related paragraphs under a heading.
2024-01-05 12:02:35 +01:00
Akhil G Krishnan 7fa6d15890 Add the nonce: true option for stylesheet_link_tag helper
This provides a shortcut for setting a Content Security Policy nonce on
a stylesheet_link_tag.

Co-authored-by: AJ Esler <ajesler@users.noreply.github.com>
2024-01-05 13:02:51 +05:30
Gareth Jones 71fefdfae5
docs: update reference to `main` branch 2024-01-05 13:01:11 +13:00
Sean Doyle cebbd1cf0a Rename `ActionView::TestCase::Behavior::{Content,RenderedViewContent}`
Closes #49818

Renames `ActionView::TestCase::Behavior::Content` to
`RenderedViewContent`, with the goal of making it more of an internal
implementation detail that's unlikely to collide with an
application-side `::Content` class.

The `RenderedView`-prefix mirrors the module's `RenderedViewsCollection`
class. Since the intention is to treat it as a private implementation
detail, `RenderedViewContent` is marked with `:nodoc:`.

Along with the rename, this commit also modifies the class inheritance,
replacing the `SimpleDelegator` superclass with `String`. [String.new][]
accepts a `String` positional argument in the same way as
`SimpleDelegator.new` accepts a delegate object positional argument.
Sharing the `String` superclass also makes it a good candidate for being
passed to [Capybara.string][] (and [Capybara::Node::Simple.new][]) like
the documentation suggests.

[Capybara.string]: https://github.com/teamcapybara/capybara/blob/3.39.2/lib/capybara.rb#L212-L242
[Capybara::Node::Simple.new]: https://github.com/teamcapybara/capybara/blob/3.39.2/lib/capybara/node/simple.rb#L23
[String.new]: https://ruby-doc.org/core/String.html#method-c-new
2024-01-04 14:35:28 -05:00
Jonathan Hefner e39373c0b0 Fix JavaScript code fence and syntax [ci-skip]
Follow-up to #49857.
2024-01-03 17:10:20 -06:00
fatkodima e5a724ad41
Merge pull request #50438 from fatkodima/schema_dump-docs
Add `schema_dump` docs to the multiple databases docs [skip ci]
2024-01-04 00:58:22 +02:00
fatkodima c4cad767f5
Merge pull request #50439 from fatkodima/migrations_paths-for-replicas
Remove setting `migrations_paths` for replicas from the docs [skip ci]
2024-01-04 00:57:46 +02:00
Akhil G Krishnan e61c4b353d Add link to API documentation for ActionView helper method 2024-01-03 23:36:10 +05:30
Rafael Mendonça França 0b3cafe4af
Merge pull request #49857 from mguan2020/ujsfix
Documented a breaking change regarding imports in @rails/ujs 7.1.0 [ci skip]
2024-01-03 12:17:18 -05:00
Rafael Mendonça França ed0455665a
Update guides/source/upgrading_ruby_on_rails.md
Co-authored-by: zzak <zzakscott@gmail.com>
2024-01-03 12:12:40 -05:00
Rafael Mendonça França 2416cc162d
Merge pull request #50555 from akhilgkrishnan/add-removal-of-ujs-in-release-note
Document removal of rails/ujs in release note [skip ci]
2024-01-03 12:11:00 -05:00
Akhil G Krishnan 27efabe89e Document removal of rails/ujs in release note 2024-01-03 19:10:52 +05:30
Akhil G Krishnan bf0f8846a7 Add .github to the default rails file structure
requested changes updated
2024-01-03 18:51:30 +05:30
Rafael Mendonça França 1e4f161084
Merge pull request #50538 from sato11/rescue-responses-docs
Resolve documentational ambiguity over `rescue_responses` [ci-skip]
2024-01-02 15:15:53 -05:00
David Heinemeier Hansson 8397eb24da
Remove rollup and test machinery for rails-ujs (#50535)
This leaves only the final compiled targets in place.
2024-01-02 16:49:36 +01:00
Junichi Sato 75dbe788cb
Resolve documentational ambiguity over `rescue_responses` [ci-skip]
The issue was raised years ago at https://github.com/rails/rails/issues/27128
where everyone involved agreed that the documentation should be worked on,
only to leave it forgotten.

I believe it is still relevant as the ambiguity remains ever since.

Also, two of exceptions which have a seat in the current default
have been missing in the documentation so this commit aligns them.
2024-01-03 00:03:04 +09:00
Akhil G Krishnan 65f4022a25
Document apply_rubocop_autocorrect_after_generate! in configuration guide (#50532)
Update requested change
2024-01-02 12:50:06 +01:00
Wladimir Braguini Domingues 7904681f77
Utilize new enum syntax
Utilize the new `enum` syntax in this guide to avoid confusion with the
old one.
2024-01-01 22:52:52 -03:00
Jonathan Hefner dfc6adc2d2
Merge pull request #50384 from skipkayhil/hm-fix-alphabetical-configuring
Fix railspect not validating alphabetical order
2024-01-01 11:37:44 -06:00
Akhil G Krishnan 04ba4fb94b Update the puma startup message 2024-01-01 11:38:05 +05:30
Matthieu Prat 070487e09e
Fix a couple of typos [ci skip] 2023-12-31 12:28:30 +01:00
Jean Boussier 1320ff0a3e
Merge pull request #2 from zzak/bump-ruby-version_check
Remove Ruby version check
2023-12-31 09:04:16 +01:00
Akhil G Krishnan 2fdec81990 Document .rubocop.yml in rails default file folder structure
review changes updated
2023-12-31 11:31:30 +05:30
zzak 110a4e6abc
Remove Ruby version check
Also includes relevant docs, inspired by 6487836af8
2023-12-31 12:38:25 +09:00
Akhil G Krishnan a0e2c79e74 Document --skip-rubocop rails command 2023-12-31 08:20:01 +05:30
Hartley McGuire 590a675c4e
Merge pull request #50485 from hexdevs/ta/fix-fedora-instructions
docs: fix ImageMagick package name on fedora [ci-skip]
2023-12-29 17:55:40 -05:00
Thiago Araujo dcdd1ef7c2 docs: fix ImageMagick package name on fedora [ci-skip]
this commit corrects the name of the ImageMagick package
on fedora (from `imagemagick` to `ImageMagick`).

ref: https://packages.fedoraproject.org/pkgs/ImageMagick/ImageMagick/
2023-12-29 14:14:15 -07:00
Gareth Jones e76c52a939
docs: update reference to `main` branch 2023-12-30 09:37:55 +13:00
Hartley McGuire 8034cac675
Fix railspect not validating alphabetical order
One of the original goals of these checks was to validate that
configuration stays in alphabetical order, as this provides a
deterministic order for the configuration to be validated against.

However, it appears there has been a regression in that check and it has
only been validating that configurations are present. This commit
restores the ordering check and then uses `railspect configuration . -a`
to fix the configurations that ended up out of order.
2023-12-27 21:25:05 -05:00
Petrik de Heus e7f2db67ca
Merge pull request #50423 from p8/guides/link-to-query-matchers
Link to query assertions in testing guide [ci-skip]
2023-12-27 23:34:00 +01:00
fatkodima 17f5a8ce6f Add `schema_dump` docs to the multiple databases docs [skip ci] 2023-12-25 22:20:53 +02:00
fatkodima 1b2dcfbfe4 Remove setting `migrations_paths` for replicas from the docs [skip ci] 2023-12-25 14:59:52 +02:00
zzak 16ff9afb2e
Merge pull request #50275 from seanpdoyle/polymorphic-rename
Provide guidance for renaming classes in polymorphic associations [ci skip]
2023-12-25 08:01:15 +09:00
JohnAnon9771 c430cc3685 doc(active_record): adding more examples about scope control 2023-12-22 00:59:58 -03:00
Petrik 557dacfff9 Link to query assertions in testing guide [ci-skip]
We can link to the recenlty added queries as edge guides link to edge
API docs.
For readability the links are extracted.
2023-12-21 18:05:19 +01:00
fatkodima f48bbff32c Expose `assert_queries_match` and `assert_no_queries_match` assertions 2023-12-21 01:30:16 +02:00
Jonathan Hefner b0048c787a Capitalize "Rails" [ci-skip] 2023-12-19 13:16:47 -06:00
Hartley McGuire 1247932c80
Merge pull request #50360 from skipkayhil/hm-docs-deprecations
Improve Deprecation API docs and guide [ci-skip]
2023-12-17 17:10:21 -05:00
fatkodima a69228efa4 Fix `guides/active_record_migrations.rb` template to use the current migrations version 2023-12-17 11:36:10 +02:00
Hartley McGuire c7ff8b975b
Add sqlite3 back to bug templates that need it
The sqlite3 gem was removed during the merging of main and gem
templates, but the resulting templates still depend on it.
2023-12-17 00:10:22 -05:00
Sean Doyle fe2632f340 Add `actionview` bug report template
Introduce Action View bug report template for contributors to reproduce
issues with failing `ActionView::TestCase` instances.

In addition to rendering ERB with the `inline:` keyword, the sample
tests also include a `Helpers` module to demonstrate how to incorporate
view helpers into the reproduction script.
2023-12-16 10:16:10 -05:00
Jean Boussier 860ab28ff5
Merge pull request #50317 from zzak/consolidate-bug_reports
Consolidate bug_report_templates and remove the gem versions
2023-12-16 13:55:26 +01:00
Mike Kasberg 6fda7ade58 Document `action_mailer.file_settings` [ci-skip]
I was reading the Action Mailer guide and noticed the settings and
defaults for the `:file` delivery method were poorly documented. These
docs were originally added back in #13728. #44422 added links to the
relevant sections of the Configuration guide, but did not link
`config.action_mailer.file_settings` because the Configuration guide is
actually missing that section.

I added a short section to the Configuration guide for
`config.action_mailer.file_settings` and linked to it from the Action
Mailer guide, following the style of the other delivery methods. Like
other delivery methods, the relevant options for `file_settings` come
from the allowed options of the `Mail::FileDelivery` class in the mail
gem.

Here's where Rails sets up this delivery method with the default
location:
9064735ec5/actionmailer/lib/action_mailer/delivery_methods.rb (L30-L31)

And here's where the mail gem uses the options:
10a4443b9d/lib/mail/network/delivery_methods/file_delivery.rb (L21)
2023-12-15 08:31:07 -07:00
Hartley McGuire f93eb16564
Improve Deprecation API docs and guide
- Link to Deprecation::Behavior in configuring guide

  The current list of options for `config.active_support.deprecation`
  was missing the newly added `:report` option. Instead of adding the
  missing option and continuing to keep 4 different lists of the same
  options in sync, I opted to replace the list with a link to the
  options in the Behavior API docs. This had the additional advantage of
  giving more information about all of the options which was not
  mentioned in the Configuring guide.

- Use symbols for Behavior options

  It felt to me like naming the options did not make it explicit that
  those were the symbols to pass to `#behavior=`, but by adding the `:`
  that becomes more clear.

- Add some API links

  There were a few references to `behavior=`, but we may as well link to
  the actual method.
2023-12-14 17:10:44 -05:00
Emmanuel Hayford 03f2b75417 Document assert_queries and assert_no_queries [ci-skip] 2023-12-14 15:10:53 +01:00
Eugene Kenny 8278626a2c
Merge pull request #49297 from hannahramadan/main
Add instrumentation for ActionController::Live#send_stream
2023-12-13 08:38:59 +00:00
hramadan 6488bd9ec0 Add instrumentation for ActionController::Live#send_stream
Allows subscribing to `send_stream` events.
The event payload contains the filename, disposition, and type.
2023-12-13 08:19:48 +00:00
notapatch cfdf868f92 Update Rack::Head documentation to match code behavior
In commit 449039a86d,
ActionDispatch::Head was replaced with Rack::Head in the
middleware. However, the documentation was not changed.

Rack::Head code behaviour is not to change HEAD into GET it is to
close the body of all HEAD requests. This commit fixes the docs
to show this.

The left-over ActionDisplayt::Head documentation is,
unsurprisingly, wrong. Rack::Head code behaviour is not to change
HEAD into GET it is to close the body of all HEAD requests.

This commit fixes the docs to show this.
2023-12-12 21:08:56 +00:00
Hartley McGuire 5316432444
Merge pull request #50335 from takmar/fix-engines-documentation
[ci skip] Update outdated documentation for Engines
2023-12-12 00:02:14 -05:00
takmar ea49d27111 Update outdated documentation for Engines 2023-12-12 13:05:55 +09:00
Hartley McGuire b41aafee6c
Document :request in start_processing's payload 2023-12-11 19:05:33 -05:00
zzak b380da71b0
Consolidate bug_report_templates and remove the gem versions
As a contributor, changing a single line to test the desired version does not warrant a separate file for each type of report.

The only argument I can see for keeping the gem versions is that users are likely reporting a bug for a specific version of Rails, typically during an upgrade. As few people are probably testing their applications against Rails main branch.

Additionally, having the gem version templates means that we are testing both main and a stable release of Rails in CI, which has some benefit.
By removing the edge version templates, we also lose that coverage in CI, but I think it's something we can fix in buildkite-config to replace the line in those guides before running them later.

IMO, the cost of separate files and the confusion it will create if we want to add more templates outweighs the benefits mentioned here.

My motivation is that I want to add more report templates, like for additional adapters, and this list will grow to be unmanageable if we keep the gem versions.
2023-12-12 07:06:29 +09:00
Ricardo Elisiário f9e21c5616
refactor: fix typo 2023-12-11 19:53:39 +00:00
Aaron Patterson 759ae9052c
Merge pull request #49472 from mateusdeap/main
[ci skip] Change `resourceful` to `resource` for clarity
2023-12-11 09:04:27 -08:00
r7kamura f06189862d Fix wrong example code: `active_job.message_serializer` 2023-12-11 14:11:29 +09:00
jbk2 3da041ef52
Correct HAVING conditions active_record example query
Correct the active_record query example, in the HAVING conditions section, to align with the corresponding given SQL output.
2023-12-08 17:26:59 +01:00
Sean Doyle 0d8b3f09af Provide guidance for renaming classes in polymorphic associations [ci skip]
Add guidance to the Association Basics and `.belongs_to` method
documentation to encourage the renaming of a model's Ruby class to
coincide with updates to the existing data in the database.

Since Action Text and Active Storage rely on polymorphic associations,
add similar warnings to their guides.

Co-authored-by: Petrik de Heus <petrik@deheus.net>
Co-authored-by: Stephen Hanson <s.hanson5@gmail.com>
Co-authored-by: zzak <zzakscott@gmail.com>
2023-12-08 09:19:21 -05:00
Petrik f30c097525 Remove some outdated security advice from Security guide [ci-skip]
Upgrading Rails to "at least 2.1.1" is outdated advice. Applications
should run 7.0.Z or 7.1.Z.
Also, RedCloth version 4 is from 2009, so I don't think it's that "new".
2023-12-08 10:15:23 +01:00
Hartley McGuire f0d66d6c47
Merge pull request #50279 from skipkayhil/hm-nfd-2
More improvements to new framework defaults doc [ci-skip]
2023-12-07 17:37:00 -05:00
Jean Boussier 745992e93e
Merge pull request #49640 from mguan2020/branch_new
Added link further explaining ERB in the 'Getting Started' documentation [ci skip]
2023-12-07 08:02:38 +01:00
Hartley McGuire d3d327bb43
More improvements to new framework defaults doc
- Explain the purpose of wrap_parameters_by_default and how it replaces
  the wrap_parameters initializer.
- Explain why action_mailer.smtp_timeout exists and why its useful
- Add example to action_view.button_to_generates_button_tag
2023-12-05 19:08:54 -05:00
Hartley McGuire c057edaaad
Merge pull request #50277 from skipkayhil/hm-nfd-open-redirects
Improve doc for raise_on_open_redirects [ci-skip]
2023-12-05 17:38:31 -05:00
Hartley McGuire 8f1b3ceb7e
Fix link to config.active_record.protocol_adapters 2023-12-05 17:15:17 -05:00
Hartley McGuire ecbe5f9bfe
Improve doc for raise_on_open_redirects
- provide a definition for an "open redirect"
- clarify what "permitted open redirect" means in this context
2023-12-05 17:10:55 -05:00
Akhil G Krishnan cc55785f4d Add actionview deprecation to 7.2 release note 2023-12-04 22:41:10 +05:30
Jean Boussier a35ceb429c
Merge pull request #50262 from Techbrunch/patch-1
Use RedCloth GitHub instead of an expired domain
2023-12-04 16:52:58 +01:00
Jean Boussier 439e8be98e
Merge pull request #50217 from fastjames/document_variant_preprocessed_option
Document the `preprocessed` variant option [ci skip]
2023-12-04 16:49:05 +01:00
Jim Kane 87c614a1d4 Document the `preprocessed` variant option 2023-12-04 09:21:01 -06:00
Techbrunch a86e8c875a
Use RedCloth GitHub instead of an expired domain 2023-12-04 14:44:30 +01:00
yysaki 7f94cb9483 Update security.md typo about HTTP Strict-Transport-Security [ci-skip] 2023-12-02 17:23:23 +09:00
Adrianna Chang 2854e378c8
Revert "Add config for validating migration timestamps" 2023-12-01 11:58:53 -05:00
Eileen M. Uchitelle c60d064fd5
Merge pull request #50205 from rails/ac-validate-migration-timestamps
Add config for validating migration timestamps
2023-11-30 16:20:49 -05:00
Adrianna Chang 06575d1d75
Add `active_record.config.validate_migration_timestamps` option.
When set, validates that the timestamp prefix for a migration is in the form YYYYMMDDHHMMSS.
This is designed to prevent migration timestamps from being modified by hand.

It is turned off by default.
2023-11-30 16:04:06 -05:00
Jean Boussier da2dbbb292
Merge pull request #50157 from Earlopain/update-erb-trim-mode-docs
Update docs for `erb_trim_mode`
2023-11-30 19:15:43 +01:00
Jean Boussier 9c22f35440
Merge pull request #50140 from kmcphillips/ar-protocol-adapter
Add a `ActiveRecord.protocol_adapters` configuration to map `DATABASE_URL` protocols to adapters at an application level
2023-11-29 17:41:51 +01:00
jbk2 aa688c1d31
Update form_helpers.md
Correcting book[title] value typo on line 265 in order that it correctly reflects it's object value stated in line 248.
2023-11-29 14:08:49 +01:00
Kevin McPhillips 0ccf300add Add an `ActiveRecord.protocol_adapters` configuration which maps the protocol in a `DATABASE_URL` to a database adapter. 2023-11-28 20:23:58 -05:00
“Apoorv d7b212626b add missing preposition in sentence 2023-11-27 22:01:07 +05:30
Earlopain 7aab98a16e
Update docs for erb_trim_mode [ci-skip] 2023-11-24 12:54:34 +01:00
Jonathan Hefner f1d3acedb5 Include Preview#url in service_urls_expire_in list [ci-skip] 2023-11-23 11:52:39 -06:00
Jonathan Hefner 252cc95d12 Link to API docs [ci-skip] 2023-11-23 11:51:49 -06:00
Jonathan Hefner 54dc0b306a Link to api.rubyonrails.org instead of edgeapi [ci-skip] 2023-11-23 11:13:15 -06:00
Vipul A M 408faa2d42
Merge pull request #49743 from yoshixi/improve-action-mailbox-incineration-doc-1
Improve docs for the action-mail box incineration
2023-11-23 18:23:31 +05:30
Rafael Mendonça França 03dae98092
Remove deprecated `:exponentially_longer` value for the `:wait` in `retry_on` 2023-11-22 22:13:59 +00:00
Rafael Mendonça França 798289699d
Remove deprecated support to set numeric values to `scheduled_at` attribute 2023-11-22 22:13:06 +00:00
Rafael Mendonça França 2a761d23d2
Remove deprecated primitive serializer for `BigDecimal` arguments 2023-11-22 22:13:03 +00:00
Rafael Mendonça França ec2c2666c2
Remove deprecated support to set `Rails.application.config.action_dispatch.show_exceptions` to `true` and `false` 2023-11-22 22:12:10 +00:00
Rafael Mendonça França 30193dc087
Remove deprecated `speaker`, `vibrate`, and `vr` permissions policy directives 2023-11-22 22:12:09 +00:00
Rafael Mendonça França d088d9132f
Remove deprecated `Rails.application.config.action_dispatch.return_only_request_media_type_on_content_type`. 2023-11-22 22:12:08 +00:00
Rafael Mendonça França 43e42c1ea8
Remove deprecated comparison between `ActionController::Parameters` and `Hash` 2023-11-22 22:12:07 +00:00
Rafael Mendonça França 87bc1190fb
Remove deprecated constant `AbstractController::Helpers::MissingHelperError` 2023-11-22 22:12:03 +00:00
Rafael Mendonça França b2f96d07d4
Remove deprecated constant `ActionDispatch::IllegalStateError` 2023-11-22 22:11:43 +00:00
Rafael Mendonça França 992a126c6e
Remove deprecated params via `:args` for `assert_enqueued_email_with` 2023-11-22 22:11:32 +00:00
Rafael Mendonça França 2bd6cf5177
Remove deprecated `config.action_mailer.preview_path` 2023-11-22 22:11:31 +00:00
Vipul A M 21b72e437e
Merge pull request #49925 from akhilgkrishnan/add-missing-methods-in-view-helper-guide
Add missing audio_tag, favicon_link_tag, video_tag methods in ActionView helper guide [ci skip]
2023-11-20 17:57:17 +05:30
Akhil G Krishnan d08c2c74eb Document docker related files in app folder structure 2023-11-19 10:31:11 +05:30
Akhil G Krishnan cf605cd05b Add missing audio_tag, favicon_link_tag, video_tag methods in ActionView helper guide
Requested changes updated
2023-11-18 22:09:39 +05:30
Michael Whittaker 4cb497fe15
link to internet archive for valgrind blog link in debugging_rails_applications.md (#50042)
The linked URL to a blog post by Evan Weaver is not available anymore.
This change uses an archived version from the internet archive.
2023-11-14 19:07:44 +01:00
sid-707 781faa1304 Fix grammar to aid readibility 2023-11-13 22:52:25 -05:00
Vipul A M 4cc1de7910
Merge pull request #50022 from akhilgkrishnan/update-rails-about-content 2023-11-13 01:27:30 +05:30
Hartley McGuire c95dad5657
Improve `set_load_path` documentation
The new documentation explicitly lists all "autoload paths" for the
reader, and mentions the `add_autoload_paths_to_load_path` config toggle

Co-authored-by: Matt <iMacTia@users.noreply.github.com>
2023-11-12 14:16:36 -05:00
Akhil G Krishnan 68d39cb1c8 Updated rails about guide content with latest data
requested changes updated
2023-11-13 00:11:59 +05:30
Hartley McGuire 09d51c93e7
Merge pull request #49979 from ttanimichi/patch-2
Not only `save(validate: false)` but also `save!(validate: false)` triggers callbacks
2023-11-12 12:42:48 -05:00
Guillaume Wrobel 07ed4f87e4
Add picture_tag to ActionView helpers guides [ci skip] 2023-11-11 18:18:30 +01:00
Akhil G Krishnan 698de01b64 Remove config.load_paths reference from guide 2023-11-11 11:40:13 +05:30
Sean Doyle 8c593873a5 Add `actionmailer` bug report template
Introduce Action Mailer bug report templates for contributors to reproduce
issues with failing `ActionMailer::TestCase` instances.
2023-11-10 12:03:28 -05:00
Y.I 10e0bddf01
[ci skip] Typo 2023-11-10 13:51:15 +02:00
Hartley McGuire e43471a80d
Merge pull request #49985 from kuranari/update-redis-cache-store-options
Update ActiveSupport::Cache::RedisCacheStore documentation [ci skip]
2023-11-09 11:05:08 -05:00
Tomohisa Kuranari d4025ab1fe Update ActiveSupport::Cache::RedisCacheStore documentation
For more info:
* https://github.com/rails/rails/issues/46149
* https://github.com/rails/rails/pull/46204
2023-11-09 23:52:00 +09:00
Aashish Saini a109b9f06a Add missing preload_link_tag in ActionView helper guide 2023-11-09 20:19:34 +05:30
Tsukuru Tanimichi a89acde9ba
Not only `save(validate: false)` but also `save!(validate: false)` triggers callbacks
```
$ cat app/models/item.rb
class Item < ApplicationRecord
  after_save { puts 'Item saved' }

  validates :name, presence: true
end

$ bin/rails r 'Item.new.save(validate: false)'
Item saved

$ bin/rails r 'Item.new.save!(validate: false)'
Item saved

$ bin/rails r 'Item.new.save!'
/Users/ttanimichi/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/activerecord-7.1.1/lib/active_record/validations.rb:84:in `raise_validation_error': Validation failed: Name can't be blank (ActiveRecord::RecordInvalid)
```
2023-11-09 15:42:08 +09:00
yoshiki masubuchi 2655cad028 Improve action_mailbox_basics.md 2023-11-06 08:48:55 +09:00
Akhil G Krishnan a60e1a2380 API documentation reference added to view helper 2023-11-05 09:23:30 +05:30
mguan2020 1ca27cc4ab Documented a breaking change regarding imports in @rails/ujs 7.1.0 2023-11-04 17:51:56 +00:00
Petrik a904df9087 Move the association callbacks section to the callbacks guides [ci-skip]
Association callbacks were missing in the callbacks guide.
We can still keep a small section in the associations guide that links
to the callbacks guide.
2023-11-03 22:29:39 +01:00
Masahito Osako 9a1d027c97 Update new nodejs installation method in development_dependencies_install document.
Because the traditional `setup_XX.x` script is deprecated, and there is a need to migrate to the new installation method.
2023-11-03 22:03:51 +09:00
Petrik de Heus bbc6230ae7
Merge pull request #49888 from p8/guides/ar-callbacks-ordering
Expand the transaction callback ordering in guides [ci-skip]
2023-11-02 10:26:13 +01:00
Petrik 14acab20a2 Expand the transaction callback ordering in guides [ci-skip]
The ordering can now be configured.

Also update the Configuring guide and API docs. In the Configuring guide
"When true" seems more common than "When false", so that is used
instead.

Co-authored-by: Akhil G Krishnan <akhilgkrishnan4u@gmail.com>
2023-11-02 10:16:35 +01:00
Gannon McGibbon d716e6dbcc Document async option in guides for query.active_record events
Related to #load_async queries added in #40037 #41372.
2023-11-02 01:11:58 -05:00
Petrik 5b6f422c2b Clarify transaction callbacks section [ci-skip]
Rename "Dealing With Consistency" heading to "`after_commit` and
`after_rollback`. To be more inline with other headings.

The "Context Matters" heading has been renamed to "Aliases for
`after_commit`", as this section is about aliases and `Context Matters` is
a bit ambiguous.

The warnings for `after_commit` and `after_rollback` better fit with the
section about these callback methods.
2023-11-01 14:38:07 +01:00
Petrik 3393afba59 Move new warning after example of previous wanring [ci-skip] 2023-11-01 14:14:32 +01:00
Adrianna Chang 1370d043b9
Merge pull request #49831 from dhavalsingh/update_callback_docs_for_same_model_multi_instance
Update Callbacks Documentation: Specify 'after_commit' and 'after_rollback' Behavior for Multiple Objects of the Same Record [ci skip]
2023-11-01 08:42:55 -04:00
fatkodima 21d6be0dd7
Merge pull request #49882 from a5-stable/add-zettabyte-doc
Add zettabytes documentation to the guide [skip ci]
2023-11-01 12:05:28 +02:00
fatkodima 83b38751c5
Merge pull request #49880 from akhilgkrishnan/remove-period-from-title
Remove period from title [skip ci]
2023-11-01 12:02:37 +02:00
Dhaval 2e6f1dcf95 Update Callbacks Documentation: Clarify commit callback behavior with multiple instances of the same model
updated warnign to be more clear

Update Callbacks Documentation: Clarify commit callback behavior
2023-11-01 14:25:54 +05:30
a5-stable 12080ee097 update zettabytes doc 2023-11-01 16:47:35 +09:00
Akhil G Krishnan 61317a500d Typo fix: updates the rails version 2023-11-01 09:27:57 +05:30
Akhil G Krishnan 054684537e Remove period from title 2023-11-01 09:11:14 +05:30