- 22 9月, 2020 5 次提交
-
-
由 eileencodes 提交于
These weren't consistent. In some errors we were using backticks and others we weren't. This fixes `connected_to` errors to use backticks around the method name
-
由 eileencodes 提交于
These weren't consistent. In some errors we were using backticks and others we weren't. This fixes `connects_to` errors to use backticks around the method name
-
由 Eileen M. Uchitelle 提交于
Database tasks can SKIP_TEST_DATABASE with environment variable
-
由 eileencodes 提交于
Adds a note to clarify that `while_preventing_writes` is not meant to be a replacement for a readonly replica user. Closes #39132 and #39133 Co-authored-by: NEike Send <eike.send@gmail.com>
-
由 Adrianna Chang 提交于
* Add binary encoding logic into ActionDispatch::Request::Utils Moving the logic to set binary encoding into ActionDispatch::Request::Utils will allow us to encode from GET and POST in ActionDispatch::Request. * Refactor binary encoding logic - Move binary encoding calls into GET, POST and path_parameters - Remove binary encoding from ActionDispatch::Http::Request - This way, we only raise an invalid encoding exception if the controller is not requesting parameters in binary encoding * Check if encoding is valid in ActionDispatch::Request#POST and raise BadRequest if invalid * Fix multipart_params_test that has binary-encoded params containing invalid UTF-8 characters * Address PR comments * Pass action and controller to Request::Utils.set_binary_encoding [Rafael Mendonça França + Adrianna Chang]
-
- 21 9月, 2020 8 次提交
-
-
由 Eugene Kenny 提交于
Eliminate `fixture_file_upload` related deprecation warnings in actionmailbox/test
-
由 bogdanvlviv 提交于
https://buildkite.com/rails/rails/builds/71675#2b9c36e5-5504-4a8e-8c4d-af774e96ea16/954-982 https://buildkite.com/rails/rails/builds/71675#2b9c36e5-5504-4a8e-8c4d-af774e96ea16/954-988 ```bash .................DEPRECATION WARNING: Passing a path to `fixture_file_upload` relative to `fixture_path` is deprecated. In Rails 6.2, the path needs to be relative to `file_fixture_path`. Please modify the call from `fixture_file_upload("files/avatar1.jpeg")` to `fixture_file_upload("avatar1.jpeg")`. DEPRECATION WARNING: Passing a path to `fixture_file_upload` relative to `fixture_path` is deprecated. In Rails 6.2, the path needs to be relative to `file_fixture_path`. Please modify the call from `fixture_file_upload("files/avatar2.jpeg")` to `fixture_file_upload("avatar2.jpeg")`. ........................................................................ ``` `fixture_file_upload` now uses path relative to `file_fixture_path`, see https://github.com/rails/rails/pull/39086, https://github.com/rails/rails/blob/61c4be477706b721688e36a3168f86aabc625658/actionmailbox/test/test_helper.rb#L21
-
由 Ryuta Kamizono 提交于
Model#find with hash should not raise NoMethodError
-
由 jasl 提交于
-
由 utilum 提交于
* Update w3c_validtors for Ruby 3 compatibility * Update google-api-client for Ruby 3 compatibility
-
由 Michael Grosser 提交于
Using write with unless_exist + expires_in should unlock after the given expires_in and not 5 minutes later (#40260) Co-authored-by: NJye Lee <jyelee124@gmail.com> Co-authored-by: NEugene Kenny <elkenny@gmail.com>
-
由 Eugene Kenny 提交于
move ActiveRecord::Persistence#becomes logic into initialize block
-
由 Sampson Crowley 提交于
-
- 20 9月, 2020 2 次提交
-
-
由 Kasper Timm Hansen 提交于
Remove editorializing in ActionCable guide
-
由 C Nees 提交于
-
- 19 9月, 2020 2 次提交
-
-
由 Ryuta Kamizono 提交于
Remove obsolete comment [skip ci]
-
由 ohbarye 提交于
-
- 18 9月, 2020 2 次提交
-
-
由 Ryuta Kamizono 提交于
Use `IPAddr#prefix` for postgres cidr type
-
由 Rafael Mendonça França 提交于
The instance and predicate methods are used by Rails so there is no need to generate them.
-
- 17 9月, 2020 6 次提交
-
-
由 Vincent Robert 提交于
When a PDF is used for both printing and displaying. It will most likely contain a crop box in order to hide print margins when displaying the PDF. Use Poppler's parameter to automatically use the crop box (visible box) rather than the media box (printable box) in order to remove those margins when drawing the PDF. See https://manpages.debian.org/testing/poppler-utils/pdftoppm.1.en.html
-
由 eileencodes 提交于
In #40241 I forgot to fix the method's documentation. This commit fixes the docs to match the new, unreleased behavior.
-
由 Eileen M. Uchitelle 提交于
Make `role` required when using `shard` in `connected_to`
-
由 eileencodes 提交于
While working on some more indepth changes to Rails internal connection management we noticed that it's confusing in some cases that the `role` is implcit when using a `shard`. For example, if you passed a `shard` and not a `role` in an un-nested block the default `role` would be `writing`. ``` ActiveRecord::Base.connected_to(shard: :one) do # connected to writing end ``` However in cases where nesting is used it could be confusing to application authors that the role is inherited: ``` ActiveRecord::Base.connected_to(role: :reading) do ActiveRecord::Base.connected_to(shard: :one) do # will read from shard one replica, not write to primary end end ``` Since this could be potentially confusing, and extremely hard to track in complex applications, the best approach is to require `role` when using `shard` which is what this PR does. Note: the code for this method is...getting unweildy. Once the `database` argument is fully deprecated we can remove most of the guards and make `role` required by removing `nil` from the keyword argument. Until then we need to support required arguments in this round about way.
-
由 Aaron Patterson 提交于
Update translation efforts Spanish link.
-
由 Eugene Kenny 提交于
Improve Action View `translate` helper
-
- 16 9月, 2020 10 次提交
-
-
由 Jonathan Hefner 提交于
This disentangles the control flow between Action View's `translate` and I18n's `translate`. In doing so, it fixes a handful of corner cases, for which tests have now been added. It also reduces memory allocations, and improves speed when using a default: **Memory** ```ruby require "benchmark/memory" Benchmark.memory do |x| x.report("warmup") { translate(:"translations.foo"); translate(:"translations.html") } x.report("text") { translate(:"translations.foo") } x.report("html") { translate(:"translations.html") } x.report("text 1 default") { translate(:"translations.missing", default: :"translations.foo") } x.report("html 1 default") { translate(:"translations.missing", default: :"translations.html") } x.report("text 2 defaults") { translate(:"translations.missing", default: [:"translations.missing", :"translations.foo"]) } x.report("html 2 defaults") { translate(:"translations.missing", default: [:"translations.missing", :"translations.html"]) } end ``` Before: ``` text 1.240k memsize ( 0.000 retained) 13.000 objects ( 0.000 retained) 2.000 strings ( 0.000 retained) html 1.600k memsize ( 0.000 retained) 19.000 objects ( 0.000 retained) 2.000 strings ( 0.000 retained) text 1 default 4.728k memsize ( 1.200k retained) 39.000 objects ( 4.000 retained) 5.000 strings ( 0.000 retained) html 1 default 5.056k memsize ( 1.160k retained) 41.000 objects ( 3.000 retained) 4.000 strings ( 0.000 retained) text 2 defaults 7.464k memsize ( 2.392k retained) 54.000 objects ( 6.000 retained) 4.000 strings ( 0.000 retained) html 2 defaults 7.944k memsize ( 2.384k retained) 60.000 objects ( 6.000 retained) 4.000 strings ( 0.000 retained) ``` After: ``` text 952.000 memsize ( 0.000 retained) 9.000 objects ( 0.000 retained) 1.000 strings ( 0.000 retained) html 1.008k memsize ( 0.000 retained) 10.000 objects ( 0.000 retained) 1.000 strings ( 0.000 retained) text 1 default 2.400k memsize ( 40.000 retained) 24.000 objects ( 1.000 retained) 4.000 strings ( 0.000 retained) html 1 default 2.464k memsize ( 0.000 retained) 22.000 objects ( 0.000 retained) 2.000 strings ( 0.000 retained) text 2 defaults 3.232k memsize ( 0.000 retained) 30.000 objects ( 0.000 retained) 2.000 strings ( 0.000 retained) html 2 defaults 3.456k memsize ( 0.000 retained) 32.000 objects ( 0.000 retained) 2.000 strings ( 0.000 retained) ``` **Speed** ```ruby require "benchmark/ips" Benchmark.ips do |x| x.report("text") { translate(:"translations.foo") } x.report("html") { translate(:"translations.html") } x.report("text 1 default") { translate(:"translations.missing", default: :"translations.foo") } x.report("html 1 default") { translate(:"translations.missing", default: :"translations.html") } x.report("text 2 defaults") { translate(:"translations.missing", default: [:"translations.missing", :"translations.foo"]) } x.report("html 2 defaults") { translate(:"translations.missing", default: [:"translations.missing", :"translations.html"]) } end ``` Before: ``` text 35.685k (± 0.7%) i/s - 179.050k in 5.017773s html 28.569k (± 3.1%) i/s - 143.871k in 5.040128s text 1 default 13.953k (± 2.0%) i/s - 70.737k in 5.071651s html 1 default 12.507k (± 0.4%) i/s - 63.546k in 5.080908s text 2 defaults 9.103k (± 0.3%) i/s - 46.308k in 5.087323s html 2 defaults 8.570k (± 4.3%) i/s - 43.071k in 5.034322s ``` After: ``` text 36.694k (± 2.0%) i/s - 186.864k in 5.094367s html 30.415k (± 0.5%) i/s - 152.900k in 5.027226s text 1 default 18.095k (± 2.7%) i/s - 91.086k in 5.036857s html 1 default 15.934k (± 1.7%) i/s - 80.223k in 5.036085s text 2 defaults 12.179k (± 0.6%) i/s - 61.659k in 5.062910s html 2 defaults 11.193k (± 2.1%) i/s - 56.406k in 5.041433s ```
-
由 Akira Matsuda 提交于
-
由 Akira Matsuda 提交于
-
由 Akira Matsuda 提交于
-
由 Akira Matsuda 提交于
-
由 Akira Matsuda 提交于
-
由 Akira Matsuda 提交于
-
由 Ryuta Kamizono 提交于
https://github.com/rails/rails/commit/895134bcff294b05d6f6ebb101f60e3083ec5461#diff-7789e18ec0a61c6845755a257e6eb34fR3 https://github.com/rails/rails/commit/ee9e308f686ac1c7b0714671a1dcf1d96de87d70#diff-5e9551294914b338d923032fa904c6beR103 https://github.com/rails/rails/commit/5f63c771f7ce751fefd000470bf4ccab421988d7#diff-600d5368b55e46ed961abb4295977ac3R506 https://github.com/rails/rails/commit/48b6bacbc534d4be3fa89bc19ea83c357a20e598#diff-279ac5c088a3ee7e9f954bbc10d1b773R246 https://github.com/rails/rails/commit/49adb7f4c61de8cbb02c4a207dbd56093d99e795#diff-0cbe7171fdd7821fd5836896849141c0R111 https://github.com/rails/rails/commit/9bfe89e68ee61d9c8ed71ac98c783a7e47bdb608#diff-9c1c95b001e3680ba8a473cf23508b68R8 https://github.com/rails/rails/commit/a0f18e60900fc45eb3524ab3cdfe57be430d6016#diff-bef0ae2c16dacf77bfd2ba099af8a330R47 https://github.com/rails/rails/commit/8b4d344815655027d9f7584c0a59271dce8f1d5a#diff-09660f59aee7ec893ad609315e8843c5R18 https://github.com/rails/rails/commit/49d1b5a98dc50ca59bbfb817f90eb5c2c2645d30#diff-531e71a9d5fdc8181f38ce4416553694R107 https://github.com/rails/rails/commit/b674f04756e2e23fc18308319e4de8ff562575f4#diff-7521c0bb452244663b689e77658e63e3R98 https://github.com/rails/rails/commit/a9012af6883284a35bc5e6166507d429fe10482d#diff-60bdcf1e1954ec56d41fc4c7bd8d3e39R512 https://github.com/rails/rails/commit/6380aee182a6acb4f5062c5aa377d290e696e4b7#diff-5158c234d5e19bb1cffadcbc088400f1R262 https://github.com/rails/rails/commit/c7820d8124c854760a4d288334f185de2fb99446#diff-f4614e7ba8081c0c9e20fe64b6374228R60 https://github.com/rails/rails/commit/8df7ed3b88fc9f19446d7207a745a331893b81cd#diff-0495ed68f82d1bbde593ab5491eab24aR169 https://github.com/rails/rails/commit/6f94260ac67755fbc4d89e7dd9ba6be04abfa9e7#diff-7ecb6672f3fd37dfb79c4539395d3857R28 https://github.com/rails/rails/commit/03e44f93001db97953917e0a100c627e189e2be6#diff-e9234c4c6668852448059c0a35840bcaR185
-
由 Aaron Patterson 提交于
Use indentity hashes in Journey::GTG::Builder
-
由 Jean Boussier 提交于
-
- 15 9月, 2020 4 次提交
-
-
由 Jason Schweier 提交于
Co-Authored-By: NBob Whitelock <bob.whitelock1@gmail.com> Co-Authored-By: NRafael França <rafael@franca.dev> Co-Authored-By: NKapilSachdev <kapilsachdev03@gmail.com>
-
由 Daniel Colson 提交于
`IPAddr#prefix` was added in https://github.com/ruby/ipaddr/commit/293ad5ac6ed704f91d418ecaf24ae58156a5 and imported into Ruby 2.5 in https://github.com/ruby/ruby/commit/c2db917b3db09e3738529d5a45315b77d12ae4c3 Since Rails now uses Ruby >= 2.5 we can safely rely on `IPAddr#prefix` instead of reaching into instance variables.
-
由 Ryuta Kamizono 提交于
-
由 Akira Matsuda 提交于
-
- 14 9月, 2020 1 次提交
-
-
由 Eileen M. Uchitelle 提交于
Merge pull request #40219 from eileencodes/ensure-connects_to-is-always-called-on-base-or-abstract-classes Ensure `connects_to` can only be called on base or abstract classes
-