- 19 10月, 2019 7 次提交
-
-
由 mikong 提交于
-
由 Kasper Timm Hansen 提交于
Merge pull request #37508 from rmacklin/enforce-that-activestorage-compiled-bundle-is-in-sync-with-source-code Enforce that activestorage compiled JS is in sync with source code
-
由 Richard Macklin 提交于
(Note: this is effectively the same change that we did for actioncable in fefc3041 applied to activestorage.) We have run into issues in the past where the activestorage compiled javascript bundle got out of sync with the source code. For example, in 880f9779 the compiled bundle was modified in a way that was inconsistent with the results of running `yarn build` in the activestorage directory. This meant that running `yarn build` there would produce a dirty git status indicating changes to the compiled bundle, despite not having made any changes to the activestorage javascript source code. That particular inconsistency was fixed in 0e77706d. However, the same problem could reoccur. To address this, I've added a new test to enforce that activestorage's compiled javascript bundle is in sync with the source code. When the compiled bundle is in sync with the source code, the test will pass. However, if the two are not in sync, the test will fail. For example, if you were to apply the following patch (which only updates the source code): ``` diff --git a/activestorage/app/javascript/activestorage/index.js b/activestorage/app/javascript/activestorage/index.js index a340008fb9..a05b7223a5 100644 --- a/activestorage/app/javascript/activestorage/index.js +++ b/activestorage/app/javascript/activestorage/index.js @@ -8,4 +8,4 @@ function autostart() { } } -setTimeout(autostart, 1) +setTimeout(autostart, 2) ``` the test would then fail. Thus, the activestorage test suite will now prevent "the compiled bundle is out of sync" issues going forward.
-
由 Kasper Timm Hansen 提交于
-
由 Richard Macklin 提交于
We have run into issues in the past where the actioncable compiled javascript bundle got out of sync with the source code. For example, in 30a0c7e0 only the compiled bundle was modified. This meant that anyone who ran `yarn build` in the actioncable directory would then see a dirty git status indicating changes to the compiled bundle, despite not having made any changes to the actioncable javascript source code. We fixed that particular inconsistency in a4c27588. However, the same problem could reoccur. To address this, I've added a new test to enforce that actioncable's compiled javascript bundle is in sync with the source code. When the compiled bundle is in sync with the source code, the test will pass: $ bundle exec ruby -Itest test/javascript_package_test.rb Run options: --seed 19308 # Running: yarn run v1.12.3 $ yarn lint && bundle exec rake assets:codegen $ eslint app/javascript $ rollup --config rollup.config.js app/javascript/action_cable/index.js → app/assets/javascripts/action_cable.js... created app/assets/javascripts/action_cable.js in 762ms
✨ Done in 6.35s. . Finished in 7.130345s, 0.1402 runs/s, 0.1402 assertions/s. 1 runs, 1 assertions, 0 failures, 0 errors, 0 skips However, if the two are not in sync, the test will fail. For example, if you were to apply the following patch (which only updates the source code): ``` diff --git a/actioncable/app/javascript/action_cable/adapters.js b/actioncable/app/javascript/action_cable/adapters.js index 4de8131438..d38d9a6a0b 100644 --- a/actioncable/app/javascript/action_cable/adapters.js +++ b/actioncable/app/javascript/action_cable/adapters.js @@ -1,4 +1,5 @@ export default { + foo: self.foo, logger: self.console, WebSocket: self.WebSocket } ``` the test would then fail like this: $ bundle exec ruby -Itest test/javascript_package_test.rb Run options: --seed 26377 # Running: yarn run v1.12.3 $ yarn lint && bundle exec rake assets:codegen $ eslint app/javascript $ rollup --config rollup.config.js app/javascript/action_cable/index.js → app/assets/javascripts/action_cable.js... created app/assets/javascripts/action_cable.js in 776ms✨ Done in 5.55s. F Failure: JavascriptPackageTest#test_compiled_code_is_in_sync_with_source_code [test/javascript_package_test.rb:16]: --- expected +++ actual @@ -3,6 +3,7 @@ })(this, function(exports) { \"use strict\"; var adapters = { + foo: self.foo, logger: self.console, WebSocket: self.WebSocket }; rails test test/javascript_package_test.rb:9 Finished in 5.837403s, 0.1713 runs/s, 0.1713 assertions/s. 1 runs, 1 assertions, 1 failures, 0 errors, 0 skips Thus, the actioncable test suite will now prevent "the compiled bundle is out of sync" issues going forward. -
由 Kasper Timm Hansen 提交于
Co-authored-by: NChristian Gregg <c_arlt@hotmail.com>
-
由 Christian Gregg 提交于
When `ActiveSupport.parse_json_times` is `true`, `ActiveSupport::Messages::Medata.verify` will fail with a `TypeError` as it does not pass a `String` to `Time.iso8601` as is expected. This leads to hard-failure on retrieval of signed cookies with expiries.
-
- 18 10月, 2019 6 次提交
-
-
由 Rafael França 提交于
Add methods to the public API of ActiveRecord::Inheritance
-
由 Rafael Mendonça França 提交于
Those methods make possible to extend STI and Polymorphic associations. They are useful for cases where you renamed a class and the name of the class doesn't match the data in the database. You can now implement those methods in your model to load records with name of classes that don't exist anymore. A simple implementation would look like: class Animal < ActiveRecord::Base @@old_names = { "Lion" => "BigCat" } def self.sti_name name = super @@old_names[name] || name end def self.sti_class_for(type_name) @@old_names.inverse[type_name]&.constantize || super end end
-
由 Ryuta Kamizono 提交于
Fix random CI fail due to non-deterministic order
-
由 Jonathan Hefner 提交于
See https://buildkite.com/rails/rails/builds/64385#78d02d3f-51b4-45fc-af67-a5b9b543d2cc Although `in_batches` does apply an order to prevent batch overlap, the relation it yields to its block does not. Therefore, test results must be sorted for comparison.
-
由 Ryuta Kamizono 提交于
The intent of that tests is completely covered by with order version.
-
由 Ryuta Kamizono 提交于
Enumerator should be supported by ActiveSupport::SafeBuffer
-
- 17 10月, 2019 10 次提交
-
-
由 Jonathan Hefner 提交于
Follow-up to #33615 and #37447.
-
由 Shugo Maeda 提交于
Back references cannot be set because C level Proc doesn't support Binding. This commit fixes #37422.
-
由 Ryuta Kamizono 提交于
Merge pull request #37489 from giraffate/fix_random_ci_failure_due_to_non-deterministic_sorting_order Fix random CI failure due to non-deterministic sorting order
-
由 Kasper Timm Hansen 提交于
-
由 sinsoku 提交于
When editing credentials.yml.enc after creating a symbolic link, the symbolic link is removed and overwritten with a normal file. This commit changes the behavior to keep the symbolic link. In case of using a dead symbolic link that link is revived after writing. Fixes #36411
-
由 Paul McMahon 提交于
A class is only a direct descendant if its superclass is self. Fixes https://github.com/rails/rails/pull/37487
-
由 Paul McMahon 提交于
-
由 eileencodes 提交于
We don't want users or apps to use Role, so nodoc it.
-
由 Eileen M. Uchitelle 提交于
Manage connection pools in a new Role class rather than in DatabaseConfig
-
- 16 10月, 2019 8 次提交
-
-
由 Kasper Timm Hansen 提交于
Use ObjectSpace.each_object enumerator in descendants
-
由 Paul McMahon 提交于
-
由 Paul McMahon 提交于
-
由 Ryuta Kamizono 提交于
Remove patch for old JRuby versions
-
由 Paul McMahon 提交于
JRuby 9.0.5.0 (released January 26 2016 and Ruby 2.2 compatible) supports each_object(singleton_class) (#22385). Given that Rails 6 requires Ruby 2.5.0 or newer, we should be able to drop support for versions of JRuby older than 9.0.5.0.
-
由 Rafael França 提交于
Support ActiveModel::Error translation lookup on indexed attributes.
-
由 jonathankwok 提交于
-
由 Gannon McGibbon 提交于
Opt into has many inverse
-
- 15 10月, 2019 9 次提交
-
-
由 Richard Schneeman 提交于
Documentation: Add two RDoc links to methods
-
由 Martin Bjeldbak Madsen 提交于
-
由 Ryuta Kamizono 提交于
Update multi_json to the latest version
-
由 utilum 提交于
Avoid `warning: tried to create a Proc object without giving a block` in Ruby head. Fixed in intridea/multi_json@26a94ab8c78a394cc237e2ea292c1de4f6ed30d7 .
-
由 glaszig 提交于
-
由 Richard Schneeman 提交于
[ci skip] Remove reference to legacy Rails 2.x command
-
由 Matt Duszynski 提交于
-
由 Ryuta Kamizono 提交于
Fixed performance regression introduced MySQL 8.0
-
由 Ron Wilson 提交于
-