- 21 10月, 2019 7 次提交
-
-
由 John Crepezzi 提交于
Rather than return a configuration hash from `resolve_config_for_connection` which also discards the `env_name` and `spec_name`, return a `DatabaseConfig` object! Also make this method private since it's only used inside this class. Co-authored-by: Neileencodes <eileencodes@gmail.com>
-
由 Ryuta Kamizono 提交于
-
由 Eileen M. Uchitelle 提交于
Merge ConnectionSpecification + Role -> Role
-
由 Ryuta Kamizono 提交于
Avoid LazilyDefinedAttributes being included multiple times in class, and remove methods after first use
-
由 Chris Salzberg 提交于
LazilyDefineAttributes only needs to stay in the model's ancestors long enough to define accessors for acceptance attributes, after that it is not needed anymore. To optimize this, we eagerly define attributes as soon as either +method_missing+ or +respond_to_missing?+ is called, then immediately remove those methods from the module so that future calls will incur no performance penalty. I've also removed the call to +define_attribute_methods+ here, which is no longer be necessary to avoid an infinite loop.
-
由 Ryuta Kamizono 提交于
Remove unused require
-
由 Takayuki Nakata 提交于
`wrap` was removed at 6490d652
-
- 20 10月, 2019 3 次提交
-
-
由 Ryuta Kamizono 提交于
-
由 Ryuta Kamizono 提交于
-
由 Ryuta Kamizono 提交于
Fix new instance creation on association relation to respect unscope
-
- 19 10月, 2019 7 次提交
-
-
由 Ryuta Kamizono 提交于
The intent of #35868 is to make the association loading consistently, it should not have any side-effect for new instance creation on association relation. Fixes #37138.
-
由 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 7 次提交
-
-
由 eileencodes 提交于
In order to move schema_cache off of DatabaseConfiguration we needed to make role accessible on pool. While looking at `ConnectionSpecification`, `Role`, and `DatabaseConfig` John and I noticed that this could be achieved by merging `ConnectionSpecification` and `Role` into one `Role` class. This allows us to eliminate the `spec` concept which is confusing. `spec` is a private method so renaming to `resolve_role` is ok. In the `Role` class we took `name` (renamed to `connection_specification_name` for clarity since it's not a `role` name) and `db_config` from `ConnectionSpecification` and the `pool` methods from `Role` and combined them into one `Role` class. This feels a lot cleaner to us because it clarifies the purposes of the classes/methods/variables, and makes it easier to drop `connection_specification_name` keyed on the parent class in the future. There are a lot of changes in here but the majority of them are find and replace `spec` -> `role`, `spec.name` -> `role.connection_specification_name`, `Resolver#spec` -> `Resolver#resolve_role`. This PR also moves the `schema_cache` from `DatabaseConfig` to the new combined `Role` class. Co-authored-by: NJohn Crepezzi <john.crepezzi@gmail.com>
-
由 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 6 次提交
-
-
由 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.
-