Commit Graph

80073 Commits

Author SHA1 Message Date
Stefan Stüben
64fd666e16 Incorporate feedback 2021-04-29 13:01:39 +02:00
Michał Begejowicz
2cf41d7a5e Add support for generated columns in PostgreSQL 2021-04-29 13:01:38 +02:00
John Hawthorn
e2781c2d93 Use filter_map for template_glob 2021-04-28 16:05:32 -07:00
John Hawthorn
43ec4cef32
Merge pull request #42099 from jhawthorn/optimize_virtual
Extract and optimize virtual path building
2021-04-28 16:05:18 -07:00
Zachary Scott
739bda1e80
Merge pull request #42096 from jadeforrest/patch-1
Specify rails --version check should be in a new terminal
2021-04-29 07:51:16 +09:00
John Hawthorn
7faa50cb32 Extract and optimize virtual path building
Before:  build      1.759M (± 0.4%) i/s -      8.855M in   5.034065s
After:   build      2.700M (± 0.8%) i/s -     13.584M in   5.031691s
2021-04-28 15:14:49 -07:00
Jade Rubick
d97b9290ca
Specify rails --version check should be in a new terminal
After doing gem install rails, your environment won't pick up the fact you have rails installed unless you create a new terminal window for it. This can trip people up, so adding a few words to the guide will prevent people from having to search for [why Rails is needing to be installed as root](https://stackoverflow.com/questions/7788946/rails-keeps-telling-me-that-its-not-currently-installed). Worse, without that guidance, many people will install rails as root, when that is unnecessary.
2021-04-28 10:13:02 -07:00
Ryuta Kamizono
adc0146a07
Merge pull request #42093 from adityapandit17/typo_fixes
Fixed typo in new framework default template [ci skip]
2021-04-28 18:41:51 +09:00
Aditya Pandit
4539145ddc Fixed typo in new framework default template [ci skip] 2021-04-28 14:48:59 +05:30
Rafael Mendonça França
52db7f2ef3
Configure a default timeout for the smtp delivery method
The default is set to 5 and only applied for new applications or
applications that opt-in for this new default.

Closes #42089.

[André Luis Leal Cardoso Junior + Rafael Mendonça França]
2021-04-28 03:59:19 +00:00
Rafael Mendonça França
cbcface6c0
Document the defaults of cache_format_version
And add its new default to the new_framework_defaults_7_0 file.
2021-04-28 03:58:38 +00:00
Rafael Mendonça França
d6895fb8b4
Register autload for Deduplicable
This module is used in many classes but only required in one of them.
Depending in the load order, it could be undefined before its first use.

Instead of adding requires to every single files that use it I
registered an autoload entry for it.
2021-04-28 03:37:07 +00:00
Rafael França
83db2337bc
Merge pull request #42091 from adityapandit17/action_text_package_json_fixes
Updated actiontext package file to use latest version
2021-04-27 23:20:05 -04:00
Rafael França
de9934509f
Merge pull request #42092 from yahonda/revert_42088
Revert "Merge pull request #42088 from yahonda/use_beaneater10"
2021-04-27 23:19:27 -04:00
Rafael França
503e83dc5e
Merge pull request #41248 from andrehjr/add-action-mailer-default-timeout
Document open_timeout and read_timeout for SMTP Settings on ActionMailer
2021-04-27 23:12:56 -04:00
Yasuo Honda
06d5997b78 Revert "Merge pull request #42088 from yahonda/use_beaneater10"
This reverts commit 0184a019353fa862c37ae61308e62e4e702c347f, reversing
changes made to ed8667df5cd4d4026d803b59e6a8f1af910ae3e3.
2021-04-28 11:47:51 +09:00
Eugene Kenny
217f0e81d1 Add test coverage for bulk altering timestamps 2021-04-28 03:30:01 +01:00
Zachary Scott
4913525180
Merge pull request #42081 from jharrilim/patch-1
Docs - ActionCable Overview - Syntax Error
2021-04-28 09:51:20 +09:00
Zachary Scott
2afb94a67a
Merge pull request #42082 from ghiculescu/patch-4
Tidy up wording in "Action Mailer Configuration for Gmail" [skip ci] [docs]
2021-04-28 09:50:35 +09:00
Aditya Pandit
848cda0609 Updated actiontext package file to use latest version 2021-04-28 03:29:24 +05:30
Matthew Draper
0184a01935
Merge pull request #42088 from yahonda/use_beaneater10
Use beaneater 1.0.0 to workardound `ArgumentError: wrong number of arguments` error
2021-04-27 23:32:57 +09:30
Yasuo Honda
b0ce854e68 Use beaneater 1.0.0 to workardound ArgumentError: wrong number of arguments error
This commit addresses Rails CI `ArgumentError: wrong number of arguments (given 2, expected 1)`
errors at https://buildkite.com/rails/rails/builds/76966#8aea460d-a196-4a38-a7dc-b41af5187d9a/1485-1518
by locking `beaneater` version to 1.0.0. Because `backburner` gem depends on `beaneater`.
and `beaneater` 1.1.0 has been released which triggers this error.

- Errors are reported at Rails CI
https://buildkite.com/rails/rails/builds/76966#8aea460d-a196-4a38-a7dc-b41af5187d9a/1485-1518

- Steps to reproduce
```
git clone https://github.com/rails/rails
cd rails
rm Gemfile.lock
bundle install
cd activejob
bundle exec rake test:integration:backburner
```

- Expected behavior
It should pass

- Actual behavior
ArgumentError: wrong number of arguments (given 2, expected 1)

This workaround can be removed newer versions of `beaneater` released
including this pull request or similar fix.
https://github.com/beanstalkd/beaneater/pull/80
2021-04-27 22:38:36 +09:00
Jean Boussier
ed8667df5c Silence assert_slower_by_at_most by default
Tests shouldn't have any output if they pass.
2021-04-27 09:34:43 +02:00
Rafael França
4c91c7f2e1
Merge pull request #42083 from SkipKayhil/use-filter-map
use ruby 2.7's filter_map instead of select + map
2021-04-26 18:39:17 -04:00
Hartley McGuire
a3e5e8d909 use ruby 2.7's filter_map instead of select + map
Related: c3d7794, bbbc861
2021-04-26 17:55:33 -04:00
Eileen M. Uchitelle
43a0fab163
Merge pull request #41112 from eileencodes/fix-strict-loading-with-reload
Ensure `reload` re-applies preload values for strict loading
2021-04-26 17:07:14 -04:00
eileencodes
3328cd1d69
Ensure reload re-applies preload values for strict loading
If you have an application that has strict_loading set and then call
`reload` that would cause the preload values to get lost and
applications would start throwing a stict loading violation error.

In order to fix this we capture the association cache and re-apply that
to the reloaded records to avoid the strict loading error. Of course if
you never preloaded your records, this will still raise a strict loading
violation.

This change also removes the `reload` definition from associations.rb
because we can get the same behavior when we reassign the association
cache.

Co-authored-by: Aaron Patterson <tenderlove@ruby-lang.org>
2021-04-26 15:45:39 -04:00
Alex Ghiculescu
c8865f0bf5
Tidy up wording in "Action Mailer Configuration for Gmail" [skip ci] [docs]
Avoid using the word "now" as this makes the documentation less timeless.
2021-04-26 14:25:10 -05:00
Joe
dcff2f27ca
Fix javascript syntax 2021-04-26 15:21:46 -04:00
Eileen M. Uchitelle
ba1ec19013
Merge pull request #42060 from Tonkpils/tonkpils/fix-enlist-fixture-connections
Ensure variables are set in case enlist_fixture_connections is called
2021-04-26 09:35:25 -04:00
Jean Boussier
0beae875ee
Merge pull request #42076 from Shopify/document-as-cache-upgrade
Document the new Active Support cache format
2021-04-26 12:14:56 +02:00
Jean Boussier
fbf3bf8cac Document the new Active Support cache format 2021-04-26 11:20:59 +02:00
Sean Doyle
68bb2650d5 Action Text: forward form: option to hidden input
Trix's `<trix-editor>` doesn't support the [form][] property like
`<textarea>` or other form fields.

For example, consider the following HTML and event listener:

```html
<form action="/articles" method="post">
  <textarea name="content"></textarea>

  <button type="submit">Save</button>
</form>

<script>
  addEventListener("keydown", ({ key, metaKey, target }) => {
    if (target.form && key == "Enter" && (metaKey || ctrlKey)) {
      form.requestSubmit()
    }
  })
</script>
```

The `target` (an instance of `HTMLTextAreaElement` relies on the
[HTMLTextAreaElement.form][] property for access to its associated
`<form>`. While it's usually equivalent to `target.closest("form")`,
that isn't always the case. Declaring a `[form]` attribute with another
`<form>` element's `[id]` value can associate a field to a `<form>` that
is _not an ancestor_. That means that the event listener from above
would continue to work with this HTML:

```html
<textarea name="content" form="new_article"></textarea>

<!-- elsewhere -->
<form id="new_article" action="/articles" method="post">
  <button type="submit">Save</button>
</form>
```

Unfortunately, if the `<textarea>` element were replaced with a
`<trix-editor>`, the event listener's reliance on accessing the form as
a property would break, since the `<trix-editor>` custom element doesn't
declare that property. There is currently a pull request
([basecamp/trix#899][]) to add support for accessing the `form` as a
property of the `<trix-editor>` element.

The [feedback][] provided on that pull request suggests that we
implement the `form` property by delegating to the `<input
type="hidden">` element. Currently, `<input type="hidden">` elements
constructed by Action Text helpers cannot declare the `[form]`
attribute.

This commit adds support by special-casing the `options[:form]` key
within `ActionText::TagHelper#rich_text_area_tag`.

[form]: https://developer.mozilla.org/en-US/docs/Web/API/HTMLTextAreaElement#properties
[basecamp/trix#899]: https://github.com/basecamp/trix/pull/899#discussion_r618543357
[feedback]: https://github.com/basecamp/trix/pull/899#discussion_r618543357
2021-04-25 20:27:24 -04:00
Ryuta Kamizono
95b45c826d Change send back to public_send
It was accidentally changed in #40095.
2021-04-26 03:23:51 +09:00
Ryuta Kamizono
052f307b23
Merge pull request #42070 from shioyama/changes_applied_public
Make changes_applied public again
2021-04-25 23:31:45 +09:00
Chris Salzberg
883292fdca
Make changes_applied public again
This was (accidentally?) made private, whereas previously it was public.
2021-04-25 22:58:46 +09:00
Jean Boussier
ac3910791d
Merge pull request #42066 from abhaynikam/minor-issues-in-comparsion-validator
Fixes a typo nor -> or in ComparisonValidator exception message
2021-04-25 13:13:39 +02:00
Ryuta Kamizono
2d040e756e Fix typo s/PostgresSQL/PostgreSQL/ [ci skip] 2021-04-25 20:09:39 +09:00
Ryuta Kamizono
90db24436a Fix typo s/limitions/limitations/ [ci skip] 2021-04-25 20:04:57 +09:00
Jean Boussier
18db06286a
Merge pull request #42025 from Shopify/optimized-entry-serialization-2
Implement an optimized Cache::Entry coder
2021-04-25 12:22:17 +02:00
Jean Boussier
3b71f3eb68 Implement an optimized Cache::Entry coder
Active Support's cache have for long been limited because
of its format. It directly serialize its `Entry` object with
`Marshal`, so any internal change might break the format.

The current shortcommings are:

  - The minimum entry overhead is quite ridiculous:
    `Marshal.dump(ActiveSupport::Cache::Entry.new("")).bytesize # => 107`
  - Only the internal `value` is compressed, but unless it's a String, to do so
    it first need to be serialized. So we end up with `Marshal.dump(Zlib.deflate(Marshal.dump(value)))`
    which is wasteful.
2021-04-25 08:27:58 +02:00
Eugene Kenny
79744bc335 Fix fixture tests that replace connection handler
These tests have been failing intermittently since
054e19d08638e64fa9eacc9be32fb7fde4e7415c was merged.

They replace the connection handler during setup, but before that can
happen the existing handler's pool configuration has already been saved
by `setup_shared_connection_pool`. Later when the test calls
`teardown_shared_connection_pool`, it tries to restore connection pools
that do not exist in the new handler and blows up.

We can avoid this problem by calling `teardown_shared_connection_pool`
to clear the saved pools before replacing the connection handler.
2021-04-25 01:27:06 +01:00
Abhay Nikam
0b0b22a46a Fixes a typo and wordsmithing in the exception message. Typo: nor -> or 2021-04-24 21:10:24 +05:30
Ryuta Kamizono
3c5cbe8401
Merge pull request #42063 from ashiksp/comparison-validation-tests
Added more test coverage for comparison validator.
2021-04-25 00:06:58 +09:00
Ryuta Kamizono
c0c77e28ad Enable Layout/EndOfLine to prevent \r\n is included in the future
Follow up to a1afc7726b3f9a59eb2dbc21fbd7aa59927cc889.
2021-04-24 23:59:19 +09:00
Ashik Salman
b0241f300c Added more test coverage for comparison validator. 2021-04-24 19:36:35 +05:30
Ryuta Kamizono
aa7a8db604 Fix numericality validator :in with invalid args to raise ArgumentError 2021-04-24 14:35:35 +09:00
Ryuta Kamizono
f83dbe358e Fix error message on comparison validator 2021-04-24 14:26:08 +09:00
Ryuta Kamizono
a1afc7726b Convert \r\n to \n 2021-04-24 14:10:18 +09:00
Ryuta Kamizono
8a23c85f6e Fix "uninitialized constant ActiveModel::Validations::NumericalityValidator::Comparability (NameError)"
Somehow it isn't caused on CI, but it consistently causes on locally.

```
% bin/test -w
/Users/kamipo/src/github.com/rails/rails/activemodel/lib/active_model/validations.rb:85: warning: method redefined; discarding old validates_each
/Users/kamipo/src/github.com/rails/rails/activemodel/lib/active_model/validations.rb:85: warning: previous definition of validates_each was here
/Users/kamipo/src/github.com/rails/rails/activemodel/lib/active_model/validations.rb:89: warning: already initialized constant ActiveModel::Validations::ClassMethods::VALID_OPTIONS_FOR_VALIDATE
/Users/kamipo/src/github.com/rails/rails/activemodel/lib/active_model/validations.rb:89: warning: previous definition of VALID_OPTIONS_FOR_VALIDATE was here
/Users/kamipo/src/github.com/rails/rails/activemodel/lib/active_model/validations.rb:152: warning: method redefined; discarding old validate
/Users/kamipo/src/github.com/rails/rails/activemodel/lib/active_model/validations.rb:152: warning: previous definition of validate was here
/Users/kamipo/src/github.com/rails/rails/activemodel/lib/active_model/validations.rb:192: warning: method redefined; discarding old validators
/Users/kamipo/src/github.com/rails/rails/activemodel/lib/active_model/validations.rb:192: warning: previous definition of validators was here
/Users/kamipo/src/github.com/rails/rails/activemodel/lib/active_model/validations.rb:234: warning: method redefined; discarding old clear_validators!
/Users/kamipo/src/github.com/rails/rails/activemodel/lib/active_model/validations.rb:234: warning: previous definition of clear_validators! was here
/Users/kamipo/src/github.com/rails/rails/activemodel/lib/active_model/validations.rb:254: warning: method redefined; discarding old validators_on
/Users/kamipo/src/github.com/rails/rails/activemodel/lib/active_model/validations.rb:254: warning: previous definition of validators_on was here
/Users/kamipo/src/github.com/rails/rails/activemodel/lib/active_model/validations.rb:270: warning: method redefined; discarding old attribute_method?
/Users/kamipo/src/github.com/rails/rails/activemodel/lib/active_model/validations.rb:270: warning: previous definition of attribute_method? was here
/Users/kamipo/src/github.com/rails/rails/activemodel/lib/active_model/validations.rb:275: warning: method redefined; discarding old inherited
/Users/kamipo/src/github.com/rails/rails/activemodel/lib/active_model/validations.rb:275: warning: previous definition of inherited was here
/Users/kamipo/src/github.com/rails/rails/activemodel/lib/active_model/validations.rb:283: warning: method redefined; discarding old initialize_dup
/Users/kamipo/src/github.com/rails/rails/activemodel/lib/active_model/validations.rb:283: warning: previous definition of initialize_dup was here
/Users/kamipo/src/github.com/rails/rails/activemodel/lib/active_model/validations.rb:301: warning: method redefined; discarding old errors
/Users/kamipo/src/github.com/rails/rails/activemodel/lib/active_model/validations.rb:301: warning: previous definition of errors was here
/Users/kamipo/src/github.com/rails/rails/activemodel/lib/active_model/validations.rb:373: warning: method redefined; discarding old invalid?
/Users/kamipo/src/github.com/rails/rails/activemodel/lib/active_model/validations.rb:373: warning: previous definition of invalid? was here
/Users/kamipo/src/github.com/rails/rails/activemodel/lib/active_model/validations.rb:382: warning: method redefined; discarding old validate!
/Users/kamipo/src/github.com/rails/rails/activemodel/lib/active_model/validations.rb:382: warning: previous definition of validate! was here
/Users/kamipo/src/github.com/rails/rails/activemodel/lib/active_model/validations.rb:405: warning: method redefined; discarding old run_validations!
/Users/kamipo/src/github.com/rails/rails/activemodel/lib/active_model/validations.rb:405: warning: previous definition of run_validations! was here
/Users/kamipo/src/github.com/rails/rails/activemodel/lib/active_model/validations.rb:410: warning: method redefined; discarding old raise_validation_error
/Users/kamipo/src/github.com/rails/rails/activemodel/lib/active_model/validations.rb:410: warning: previous definition of raise_validation_error was here
/Users/kamipo/src/github.com/rails/rails/activemodel/lib/active_model/validations.rb:426: warning: method redefined; discarding old model
/Users/kamipo/src/github.com/rails/rails/activemodel/lib/active_model/validations.rb:428: warning: method redefined; discarding old initialize
/Users/kamipo/src/github.com/rails/rails/activemodel/lib/active_model/validations.rb:428: warning: previous definition of initialize was here
Traceback (most recent call last):
	23: from bin/test:5:in `<main>'
	22: from bin/test:5:in `require_relative'
	21: from /Users/kamipo/src/github.com/rails/rails/tools/test.rb:18:in `<top (required)>'
	20: from /Users/kamipo/src/github.com/rails/rails/railties/lib/rails/test_unit/runner.rb:40:in `run'
	19: from /Users/kamipo/src/github.com/rails/rails/railties/lib/rails/test_unit/runner.rb:52:in `load_tests'
	18: from /Users/kamipo/src/github.com/rails/rails/railties/lib/rails/test_unit/runner.rb:52:in `each'
	17: from /Users/kamipo/src/github.com/rails/rails/railties/lib/rails/test_unit/runner.rb:52:in `block in load_tests'
	16: from /Users/kamipo/src/github.com/rails/rails/railties/lib/rails/test_unit/runner.rb:52:in `require'
	15: from /Users/kamipo/src/github.com/rails/rails/activemodel/test/cases/attributes_dirty_test.rb:5:in `<top (required)>'
	14: from /Users/kamipo/src/github.com/rails/rails/activemodel/test/cases/attributes_dirty_test.rb:6:in `<class:AttributesDirtyTest>'
	13: from /Users/kamipo/src/github.com/rails/rails/activemodel/test/cases/attributes_dirty_test.rb:7:in `<class:DirtyModel>'
	12: from /Users/kamipo/src/github.com/rails/rails/activemodel/test/cases/attributes_dirty_test.rb:7:in `require'
	11: from /Users/kamipo/src/github.com/rails/rails/activemodel/lib/active_model/model.rb:3:in `<top (required)>'
	10: from /Users/kamipo/src/github.com/rails/rails/activemodel/lib/active_model/model.rb:59:in `<module:ActiveModel>'
	 9: from /Users/kamipo/src/github.com/rails/rails/activemodel/lib/active_model/model.rb:62:in `<module:Model>'
	 8: from /Users/kamipo/src/github.com/rails/rails/activemodel/lib/active_model/model.rb:62:in `require'
	 7: from /Users/kamipo/src/github.com/rails/rails/activemodel/lib/active_model/validations.rb:436:in `<top (required)>'
	 6: from /Users/kamipo/src/github.com/rails/rails/activemodel/lib/active_model/validations.rb:436:in `each'
	 5: from /Users/kamipo/src/github.com/rails/rails/activemodel/lib/active_model/validations.rb:436:in `block in <top (required)>'
	 4: from /Users/kamipo/src/github.com/rails/rails/activemodel/lib/active_model/validations.rb:436:in `require'
	 3: from /Users/kamipo/src/github.com/rails/rails/activemodel/lib/active_model/validations/numericality.rb:5:in `<top (required)>'
	 2: from /Users/kamipo/src/github.com/rails/rails/activemodel/lib/active_model/validations/numericality.rb:6:in `<module:ActiveModel>'
	 1: from /Users/kamipo/src/github.com/rails/rails/activemodel/lib/active_model/validations/numericality.rb:7:in `<module:Validations>'
/Users/kamipo/src/github.com/rails/rails/activemodel/lib/active_model/validations/numericality.rb:8:in `<class:NumericalityValidator>': uninitialized constant ActiveModel::Validations::NumericalityValidator::Comparability (NameError)
```
2021-04-24 13:46:45 +09:00