- 25 10月, 2019 3 次提交
-
-
由 Felix Livni 提交于
-
由 Kasper Timm Hansen 提交于
Fixed some grammar errors on guide doc.
-
由 Kasper Timm Hansen 提交于
[ci skip] Small fix to ActiveSupport docs
-
- 24 10月, 2019 4 次提交
-
-
由 Richard Schneeman 提交于
[ci skip] Fix lower case comments without punctuation
-
由 sinanmujan 提交于
-
由 Nursoltan Saipolda 提交于
-
由 sinanmujan 提交于
-
- 23 10月, 2019 5 次提交
-
-
由 Ryuta Kamizono 提交于
-
由 Ryuta Kamizono 提交于
Allow CTEs in read-only query with postgresql
-
由 Matthew Draper 提交于
Tidy up the build output for Active Job adapters
-
由 Matthew Draper 提交于
-
由 chrismo 提交于
Common Table Expressions in PostgreSQL allow a different way to define derived tables. Here's an example from the pg docs: WITH regional_sales AS ( SELECT region, SUM(amount) AS total_sales FROM orders GROUP BY region ), top_regions AS ( SELECT region FROM regional_sales WHERE total_sales > (SELECT SUM(total_sales)/10 FROM regional_sales) ) SELECT region, product, SUM(quantity) AS product_units, SUM(amount) AS product_sales FROM orders WHERE region IN (SELECT region FROM top_regions) GROUP BY region, product; https://www.postgresql.org/docs/current/queries-with.html This commit adds the :with keyword to the set of keywords allowed to begin a query against a `prevent_writes` PostgreSQL connection. Thx to @kamipo, this also adds the same support for sqlite3 and mysql2 https://www.sqlite.org/lang_with.html https://dev.mysql.com/doc/refman/8.0/en/with.html
-
- 22 10月, 2019 2 次提交
-
-
由 Eileen M. Uchitelle 提交于
Update Welcome Aboard text in Guides [ci skip]
-
由 Eileen M. Uchitelle 提交于
Update `rails server` terminal output in Guides [ci skip]
-
- 21 10月, 2019 12 次提交
-
-
由 Ryuta Kamizono 提交于
Refactor `association.scoping` not to rely on `klass.all`
-
由 Ryuta Kamizono 提交于
Related #35280, #37360, #37511. Using `klass.all` in `scoping` would potentially cause the warning. https://buildkite.com/rails/rails/builds/64444#203174d8-b527-4c43-9bd4-44e272f43555/996-1003
-
由 Eileen M. Uchitelle 提交于
Don't instantiate new role
-
由 eileencodes 提交于
This was a typo from #37503 where we instantiate a `Role` twice. We already have a role so we don't need to create it again.
-
由 Eileen M. Uchitelle 提交于
Return db_config from resolve_config_for_connection
-
由 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 9 次提交
-
-
由 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.
-
由 mikong 提交于
-
由 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 2 次提交
-
-
由 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
-