Commit Graph

82904 Commits

Author SHA1 Message Date
Jean Boussier 41c9d15b74 Merge pull request #44276 from Cofense/activerecord_databasetasks_check_target_version_integer
Accept _ integer notation in VERSION arg to database tasks

Also correct unrelated typo in DatabaseTasks test description.
2022-02-12 10:51:46 +01:00
Eddie Lebow ef4bf94e2c Accept `_` integer notation in VERSION arg to database tasks
Also correct unrelated typo in DatabaseTasks test description.

on-behalf-of: @Cofense <oss@cofense.com>
2022-02-12 10:51:37 +01:00
Jean Boussier d4ef8c26a5
Merge pull request #44366 from avalanche123/patch-1
Fix deserialization in LocalCache#read_multi_entries
2022-02-12 10:43:39 +01:00
Jean Boussier bcc3a49ccc
Merge pull request #44411 from byroot/aj-bigdecimal
Add missing `bigdecimal` require in `ActiveJob::Arguments`
2022-02-12 10:08:06 +01:00
Jean Boussier 4ca5aff9f0 Add missing `bigdecimal` require in `ActiveJob::Arguments`
Fix: https://github.com/rails/rails/issues/44399

Could cause `uninitialized constant ActiveJob::Arguments::BigDecimal (NameError)`
when loading Active Job in isolation.
2022-02-12 09:54:41 +01:00
Jonathan Hefner 724988697c
Merge pull request #44409 from ghousemohamed/patch-4
Improve Rails 7 documentation for the command line and asset pipeline [ci-skip]
2022-02-11 23:03:14 -06:00
Ghouse Mohamed 97bf34fdd5 Improve Rails 7 documentation for the command line and asset pipeline 2022-02-12 10:31:13 +05:30
Jonathan Hefner 97d5716f37
Merge pull request #44406 from p8/guides/working-with-js-fix-example
Fix javascript example code block [ci-skip]
2022-02-11 14:38:35 -06:00
Petrik 0657327e20 Fix javascript example code block [ci-skip]
Linebreaks are required before code blocks.
2022-02-11 21:11:35 +01:00
Gannon McGibbon d9a38662bd Fix style and misspell in action dispatch executor test 2022-02-11 14:55:33 -05:00
Aaron Patterson f9a2ad0394
Fix reloader to work with new Executor signature
This is a follow up to [CVE-2022-23633].
2022-02-11 11:48:19 -08:00
Gannon McGibbon 761a2e2552
Merge pull request #43957 from DavidColby/update-javascript-guide-for-rails-7
Update Working With JavaScript guide for Rails 7, scrap Node/Yarn from Getting Started guide
2022-02-11 14:33:20 -05:00
David Colby c144a76796 Update working with javascript guide to cover asset options and Turbo instead of UJS and remove node/yarn from getting started guide 2022-02-11 13:03:06 -06:00
Jean Boussier 10c64a472f
ActionDispatch::Executor don't fully trust `body#close`
Under certain circumstances, the middleware isn't informed that the
response body has been fully closed which result in request state not
being fully reset before the next request.

[CVE-2022-23633]
2022-02-11 10:08:04 -08:00
Ryuta Kamizono b50095f06c
Merge pull request #44390 from p8/actionpack/silence-uninitialized-ivar-warning
Silence uninitialized instance var warning in tests
2022-02-11 12:32:18 +09:00
Ryuta Kamizono af1355e76f
Merge pull request #44386 from ghousemohamed/patch-3
Fix flaky test case in CacheStoreBehavior
2022-02-11 12:24:43 +09:00
Gannon McGibbon 965367e390
Merge pull request #44393 from Edouard-chin/ec-class-module-children
Add module/class nesting consistency on newly generated application:
2022-02-10 15:51:10 -05:00
Jonathan Hefner aebde93508
Merge pull request #44394 from uxxman/activemodel_attributes_docs
Update ActiveModel::Attributes examples in docs [ci-skip]
2022-02-10 14:31:29 -06:00
Usman 3324cbdff5 Update ActiveModel::Attributes examples in docs 2022-02-11 01:19:49 +05:00
Edouard CHIN 5875c68209 Add module/class nesting consistency on newly generated application:
- These two generated files are the only two that uses a compact style
  when defining a class, (it's not the case for their non-test
  counterpart i.e. 0f3642596f/railties/lib/rails/generators/rails/app/templates/app/channels/application_cable/connection.rb.tt (L1-L2)).

  This fixes that to add some consistency and will avoid users using
  rubocop with the `Style/ClassAndModuleChildren: nested` rule to have
  to manually edit those files when generating a new app.
2022-02-10 20:02:36 +01:00
Jonathan Hefner 0f3642596f Insert space before opening parenthesis [ci-skip]
Follow-up to #44388.
2022-02-10 12:11:46 -06:00
Ghouse Mohamed c8fde9a682 Fixes flaky test case in cache_store_behaviour 2022-02-10 22:59:02 +05:30
Ryuta Kamizono e42e60e4c4
Merge pull request #44388 from p8/guides/filter-parameters-default
Update parameter filter logging guides [ci-skip]
2022-02-11 01:18:46 +09:00
Petrik c9cb1aa198 Silence uninitialized instance var warning in tests
Running the Action Pack tests outputs a warning:

    ./actionpack/test/controller/test_case_test.rb:1007: warning: instance variable @counter not initialized

Surrounding the line with silence_warnings cleans up the output.
2022-02-10 16:31:02 +01:00
Petrik e3beba127b Update parameter filter logging guides [ci-skip]
The `filter_parameters` configuration includes a list of filters in the
latest `filter_parameter_logging` initializer template.
This updates the guides to reflect those changes.
2022-02-10 15:38:25 +01:00
Rafael Mendonça França b961af3345
Merge pull request #44093 from motine/doc-hint-for-fields_for
add hint to ActionView's fields_for
2022-02-09 20:17:01 -05:00
Ryuta Kamizono 0b6d625527
Merge pull request #44381 from nvasilevski/fix-ruby27-keyword-arg-warning-in-test
Fix ruby 2.7 keyword args warning for postgresql reconnection_error test
2022-02-10 10:05:39 +09:00
Nikita Vasilevsky 241859634a Fix ruby 2.7 keyword args warning for postgresql reconnection_error test 2022-02-10 00:51:43 +00:00
Jonathan Hefner 61468079b6
Merge pull request #44306 from volmer/attributes-docs
Documentation for Active Model Attributes [ci-skip]
2022-02-09 14:33:09 -06:00
Volmer Campos Soares 07a5584999 Documentation for Active Model Attributes
This commit adds documentation to the constants and methods that are
part of Active Model's Attributes API. So far this API has been hidden
with the :nodoc: flag since its inception in Active Record and
subsequent move to Active Model (#30920 and #30985); as the API matures
and gets ready for public usage, visible documentation for its endpoints
becomes necessary.

The classes and modules being documented and publicized by this commit
are the main `Attributes` module, the `Type` namespace, and all the
standard attribute type classes included in the current API, which users
will be able to extend and replicate to suit their customization needs.

Some private modules are also receiving documetation, although they will
continue using the :nodoc: flag. Those are `Attribute` and
`AttributeSet`. Although they remain private I found useful to add some
comments to describe their responsibilities.
2022-02-09 14:17:18 -05:00
Bulat Shakirzyanov 3933a41ad5
fix LocalCache#read_multi_entries
In cache stores prepending `LocalCache`, serialized `Entry`
instances are stored in `LocalCache::LocalStore`. This
speeds up hot key lookups without a network roundtrip in a
context of a single given request.

However, with these entries being stored in their serialized
form, `#read_multi_entries` returns them directly to cache
consumers.

Instead, we will now deserialize these entries first.
2022-02-09 12:44:44 -05:00
Rafael Mendonça França 85c32e8dba
Merge pull request #44365 from nvasilevski/increment-assertions-on-assert-nothing-raised
Increment assertions count on assert_nothing_raised
2022-02-09 12:14:53 -05:00
Ryuta Kamizono 135f41d0b0
Merge pull request #44337 from paulhenri-l/patch-1
Fix empty request inside helpers test
2022-02-09 17:33:40 +09:00
Matthew Draper e578f86ae9
Merge pull request #44367 from shioyama/improve_activemodel_attribute_methods_naming
Improve class/method naming in `ActiveModel::AttributeMethods`
2022-02-09 18:47:06 +10:30
Paul-Henri Leobon 867e60f6c2
Fix empty request inside helpers test
During testing view helpers do not have access to the `request` object but they do when used inside of a view.

If we were to test a helper like this one :

```ruby
  def active?(test_path)
    request.path.match? test_path
  end
```

we would get this error : 

```
NoMethodError: undefined method `path' for nil:NilClass
```

Adding `:request` to the attr_accessor will make tests consistent with the default behavior.
2022-02-09 08:47:27 +01:00
Matthew Draper e483bc5965
Merge pull request #42990 from jrochkind/active_job_logging
Add job_id and exception message to ActiveJob retry/discard logging
2022-02-09 12:37:37 +10:30
Chris Salzberg fd415ef98d Rename target -> proxy_target 2022-02-09 10:55:10 +09:00
Chris Salzberg 251445601e Rename AttributeMethodMatcher to AttributeMethodPattern 2022-02-09 10:41:02 +09:00
Nikita Vasilevsky 6758397019 Increment assertions count on assert_nothing_raised 2022-02-09 01:01:10 +00:00
Jean Boussier 4d4497b42e
Merge pull request #44363 from ghiculescu/reverse-structure-versions
Reverse the order of `INSERT` statements in `structure.sql` dumps
2022-02-08 23:16:58 +01:00
Alex Ghiculescu 7c8ac6c0dc Reverse the order of `INSERT` statements in `structure.sql` dumps
This was suggested as a better fix in https://github.com/rails/rails/pull/43414. The goal is to decrease merge conflicts that often come at the bottom due to the semi colon placement.

We've been running with a monkey patch for it for about a month, and can confirm, it's definitely an improvement. So I'm making this as an alternative suggestion to https://github.com/rails/rails/pull/43414

Adding @mlarraz as a co-author - thanks for the original inspiration.

Co-authored-by: @mlarraz <mlarraz@users.noreply.github.com>
2022-02-08 15:55:36 -06:00
Tom Rothe c6cb78349a add hint to ActionView's fields_for 2022-02-08 22:09:08 +01:00
Jean Boussier b923f70d15
Merge pull request #44346 from nvasilevski/fix-pg-connect-ruby-27-warning
Fix PG.connect keyword arguments deprecation warning on ruby 2.7
2022-02-08 21:24:10 +01:00
Jean Boussier e420336cd6
Merge pull request #44364 from nvasilevski/fix-test-failure-after-encryption-hook-rename
Fix install_auto_filtered_parameters method rename
2022-02-08 21:22:15 +01:00
Nikita Vasilevsky c3a0e326e8 Fix PG.connect keyword arguments deprecation warning on ruby 2.7 2022-02-08 20:10:58 +00:00
Nikita Vasilevsky e722a4436f Fix install_auto_filtered_parameters method rename 2022-02-08 19:51:22 +00:00
Jean Boussier c2ce4d6e14
Merge pull request #44347 from nvasilevski/fix-postgresql-reconnection-test-assertion
Fix postgresql reconnection_error test expects wrong exception
2022-02-08 19:18:58 +01:00
Rafael Mendonça França de7c495209
Merge pull request #44354 from rails/to-fs-as-the-primary
Make #to_fs the default replacement for #to_s(:format)
2022-02-08 11:50:24 -05:00
Rafael Mendonça França 6d09cf1f83
Merge pull request #44284 from skateman/activerecord-arel-order-hash
Fixes order(ArelNode => direction) in ActiveRecord::QueryMethods
2022-02-08 11:44:45 -05:00
Rafael Mendonça França 0dfcd54052
Keep to_formatted_s working as before and add tests for it 2022-02-08 16:22:35 +00:00