Commit Graph

90116 Commits

Author SHA1 Message Date
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
Jean Boussier 6ba2fdb2fe Bump the required Ruby version to 3.1.0
Until now, Rails only droped compatibility with older
rubies on new majors, but I propose to change this policy
because it causes us to either keep compatibility with long
EOLed rubies or to bump the Rails major more often, and to
drop multiple Ruby versions at once when we bump the major.

In my opinion it's a bad alignments of incentives. And we'd
be much better to just drop support in new minors whenever they
go EOL (so 3 years).

Also Ruby being an upstream dependency, it's not even
a semver violation AFAICT.

Since Rails 7.2 isn't planned before a few months, we
can already drop Ruby 3.0 as it will be EOL in March.
2023-12-31 08:54:03 +01:00
Hartley McGuire c061e567b8
Merge pull request #50497 from akhilgkrishnan/document-rubocop-yml-in-directory-structure
Document .rubocop.yml in rails default file folder structure [skip ci]
2023-12-31 01:06:18 -05: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
Hartley McGuire 97736d7628
Merge pull request #50498 from skipkayhil/hm-doc-write-options
Document Cache::WriteOptions [ci-skip]
2023-12-31 00:45:26 -05:00
Hartley McGuire 2dda04284c
Merge pull request #50496 from skipkayhil/hm-doc-cache
Cache::Store doc improvements [ci-skip]
2023-12-31 00:37:58 -05:00
Hartley McGuire f721e719b7
Document Cache::WriteOptions 2023-12-31 00:36:19 -05:00
Hartley McGuire f042e025c1
Remove self referential links from Cache::Store
Also swap some method references to code blocks because they aren't
documented (so the auto-references don't work).
2023-12-30 23:57:50 -05:00
Hartley McGuire 7ce5d10398
Improve RedisCacheStore docs
- tweak opening paragraph to specifically mention that the Redis backing
  a Cache should not be the Redis backing Active Job
- add code blocks to Redis::Distributed since it uses the class syntax
- expand on ways to point Cache at a Redis in initialization
- add an rdoc link for #fetch and a code block for `-amount`
2023-12-30 23:38:38 -05:00
Hartley McGuire 8ee46636b7
Remove self referential links from MemoryStore 2023-12-30 23:05:34 -05:00
Hartley McGuire 285ad7bf36
Remove self referential links from MemCacheStore 2023-12-30 22:56:46 -05:00
zzak 110a4e6abc
Remove Ruby version check
Also includes relevant docs, inspired by 6487836af8
2023-12-31 12:38:25 +09:00
zzak e7826d864f
Merge pull request #50494 from akhilgkrishnan/document-skip-rubocop-command
Document --skip-rubocop rails command [skip ci]
2023-12-31 12:26:32 +09:00
Akhil G Krishnan a0e2c79e74 Document --skip-rubocop rails command 2023-12-31 08:20:01 +05:30
zzak 0fb5f67ac4
Add rubocop-rails-omakase to new Rails applications (#50486)
* Add rubocop to new rails app generator

This setups a basic rubocop config for new rails apps using the `rubocop-rails-omakase` gem:
https://github.com/rails/rubocop-rails-omakase

It can be skipped with the `--skip-rubocop` flag.
2023-12-30 21:13:13 +01:00
Jean Boussier 89c2f8530a Bump the required Ruby version to 3.1.0
Until now, Rails only droped compatibility with older
rubies on new majors, but I propose to change this policy
because it causes us to either keep compatibility with long
EOLed rubies or to bump the Rails major more often, and to
drop multiple Ruby versions at once when we bump the major.

In my opinion it's a bad alignments of incentives. And we'd
be much better to just drop support in new minors whenever they
go EOL (so 3 years).

Also Ruby being an upstream dependency, it's not even
a semver violation AFAICT.

Since Rails 7.2 isn't planned before a few months, we
can already drop Ruby 3.0 as it will be EOL in March.
2023-12-30 19:46:43 +01:00
Jean Boussier 7b9e9ee244
Merge pull request #50489 from maniSHarma7575/50481-fix-activesupport-json-encode
[FIX] Fix Activesupport json encode for hash with duplicate keys
2023-12-30 19:21:31 +01:00
Manish Sharma 94a4adb8a1 [FIX] Fix Activesupport json encode for hash 2023-12-30 20:22:11 +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
Hartley McGuire 224731232d
Merge pull request #50484 from G-Rath/patch-1
docs: update reference to `main` branch [ci skip]
2023-12-29 17:46:20 -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 f481353150
Merge pull request #50468 from fractaledmind/ar-persistence-docs
SQLite3 +returning+ documentation additions
2023-12-28 12:04:26 -05:00
Stephen Margheim 77800d1920 Update documentation for ActiveRecord persistence methods that accept +returning+ option to note that this is available for SQLite3 adapter as well
Co-authored-by: OuYangJinTing <ouyangshi95@foxmail.com>
2023-12-28 09:54:50 +01:00
Jean Boussier 354d1c42b4
Merge pull request #50463 from Shopify/remove-sqlite3-production-warning
Remove SQLite production warning but leave production config disabled
2023-12-27 23:34:47 +01: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
Jean Boussier 6b446bee63 Remove SQLite production warning but leave production config disabled
There are valid use cases for running SQLite in production, however it must be done
with care, so instead of a warning most users won't see anyway, it's preferable to
leave the configuration commented out to force them to think about having the database
on a persistent volume etc.

Co-Authored-By: Jacopo Beschi <beschi.jacopo@gmail.com>
2023-12-27 23:32:18 +01:00
Jonathan Hefner 5b62994778
Merge pull request #50418 from the-spectator/buffered_checksum
Use buffered read while generating Blob checksum to improve memory
2023-12-26 12:38:17 -06: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
Akshay Birajdar 92138c40cc Use buffered read while generating checksum for blob 2023-12-22 08:43:58 +05:30
Jonathan Hefner b1d57fb8c8
Merge pull request #50425 from wildmaples/remove-unused-arg
Remove unused argument in .db_configs_with_versions
2023-12-21 16:23:24 -06:00
Maple Ong 9572fcb4a0 Remove unused argument 2023-12-21 16:47:32 -05: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
OKURA Masafumi d9c63917b9
Doc: Prevent `Attributes` to be a link [ci-skip] (#50419)
This `Attributes` is not related to ActiveRecord's `attribute` API.
2023-12-21 16:51:20 +01:00
Jean Boussier 60df08920f
Merge pull request #50373 from fatkodima/improve-queries-assertions-matchers
Expose `assert_queries_match` and `assert_no_queries_match` assertions
2023-12-21 12:59:10 +01:00
Jean Boussier 6c0f897293
Merge pull request #50410 from fatkodima/fix-async-queries-with-query-cache
Fix async queries to work with query cache
2023-12-21 10:53:33 +01:00
fatkodima f48bbff32c Expose `assert_queries_match` and `assert_no_queries_match` assertions 2023-12-21 01:30:16 +02:00
fatkodima f68727dcd0 Fix async queries to work with query cache 2023-12-20 23:50:41 +02:00
Jonathan Hefner bf725a7876
Merge pull request #50404 from jonathanhefner/bump-psych-5_1_2
Bump `psych` gem to 5.1.2
2023-12-19 18:33:48 -06:00
Jonathan Hefner e589b1fbf5
Merge pull request #50403 from jonathanhefner/follow-up-46530
Fix inclusion of `url_helpers` module in concern
2023-12-19 18:13:10 -06:00
Jonathan Hefner adf10e9406 Bump psych gem to 5.1.2
This fixes the following error for the guides build:

  ```
  Traceback (most recent call last):
    13: from bug_report_templates/action_controller.rb:5:in `<main>'
    12: from /usr/local/bundle/gems/bundler-2.4.22/lib/bundler/inline.rb:42:in `gemfile'
    11: from /usr/local/bundle/gems/bundler-2.4.22/lib/bundler.rb:403:in `with_unbundled_env'
    10: from /usr/local/bundle/gems/bundler-2.4.22/lib/bundler.rb:649:in `with_env'
     9: from /usr/local/bundle/gems/bundler-2.4.22/lib/bundler.rb:403:in `block in with_unbundled_env'
     8: from /usr/local/bundle/gems/bundler-2.4.22/lib/bundler/inline.rb:51:in `block in gemfile'
     7: from /usr/local/bundle/gems/bundler-2.4.22/lib/bundler/settings.rb:142:in `temporary'
     6: from /usr/local/bundle/gems/bundler-2.4.22/lib/bundler/inline.rb:66:in `block (2 levels) in gemfile'
     5: from /usr/local/bundle/gems/bundler-2.4.22/lib/bundler/runtime.rb:24:in `setup'
     4: from /usr/local/bundle/gems/bundler-2.4.22/lib/bundler/runtime.rb:24:in `map'
     3: from /usr/local/bundle/gems/bundler-2.4.22/lib/bundler/spec_set.rb:165:in `each'
     2: from /usr/local/bundle/gems/bundler-2.4.22/lib/bundler/spec_set.rb:165:in `each'
     1: from /usr/local/bundle/gems/bundler-2.4.22/lib/bundler/runtime.rb:25:in `block in setup'
  /usr/local/bundle/gems/bundler-2.4.22/lib/bundler/runtime.rb:304:in `check_for_activated_spec!': You have already activated psych 5.1.1.1, but your Gemfile requires psych 5.1.2. Prepending `bundle exec` to your command may solve this. (Gem::LoadError)
  ```

This is similar to #45052.  Eventually, this should be fixed permanently
by either rubygems/rubygems#5529 or rubygems/rubygems#5535.
2023-12-19 18:03:51 -06:00
Jonathan Hefner 76c26135b9 Fix inclusion of url_helpers module in concern
Follow-up to #46530.

The dynamically generated `url_helpers` module is an
`ActiveSupport::Concern`.  Therefore, when it is included directly in
another `ActiveSupport::Concern`, its `included` block is deferred until
the latter concern is itself included elsewhere.  Thus, in that case,
the call to `base._routes` in `def self.included(base)` will raise
`NoMethodError` because the `included` block will not yet have defined
the `_routes` method.

This commit prevents the error by first checking if `base` responds to
`_routes`.
2023-12-19 17:43:32 -06:00
Jonathan Hefner b0048c787a Capitalize "Rails" [ci-skip] 2023-12-19 13:16:47 -06:00
Jonathan Hefner bf6c20edb7 Replace backticks with RDoc markup [ci-skip] 2023-12-19 13:16:47 -06:00
Jean Boussier 18b8f37192
Merge pull request #50395 from Shopify/fix-find-or-create
Fix `Relation#transaction` to not apply a default scope
2023-12-19 11:50:54 +01:00
Jean Boussier 8c9ff7cdd8 Fix `Relation#transaction` to not apply a default scope
Fix: https://github.com/rails/rails/issues/50368

When called on a scope it would go through the default scoping
delegator that applies a default scope, which make no sense.
2023-12-19 11:29:39 +01:00
Petrik de Heus 462e8e8b1c
Merge pull request #50367 from mechanicles/update-api-doc-for-activerelation-none-any-one
Update API doc for ActiveRecord::Relation#none?/#any?/#one? [ci-skip]
2023-12-18 08:26:21 +01:00
Santosh Wadghule 45ce025274
Update API doc for ActiveRecord::Relation#none?/#any?/#one? [ci-skip]
I checked https://github.com/rails/rails/issues/50327 and noticed that
clear API docs are needed. Some developers are using these methods
incorrectly, thinking they're only for Active Record Relation, but they
actually work with Enumerable.
2023-12-18 11:42:57 +05:30
David Heinemeier Hansson 2ec0ff42be
Add webp and avif as allowed formats for active storage to serve inline (#50265) 2023-12-17 17:39:04 -08: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