- 24 5月, 2020 16 次提交
-
-
由 Ryuta Kamizono 提交于
ff45b9e9 had removed that limitation for `or`. [ci skip]
-
由 Ryuta Kamizono 提交于
Follow up to #38990.
-
由 Ryuta Kamizono 提交于
Default engine `ENGINE=InnoDB` is no longer dumped to make schema more agnostic
-
由 Eugene Kenny 提交于
Copy options before delegating in with_options
-
由 Ryuta Kamizono 提交于
Otherwise we cannot handle the same name options for both column and table (e.g. `:comment`, `:charset`, `:collation`).
-
由 Ryuta Kamizono 提交于
5 years ago, I made dumping full table options at #17569, especially to dump `ENGINE=InnoDB ROW_FORMAT=DYNAMIC` to use utf8mb4 with large key prefix. In that time, omitting the default engine `ENGINE=InnoDB` was not useful since `ROW_FORMAT=DYNAMIC` always remains as long as using utf8mb4 with large key prefix. But now, MySQL 5.7.9 has finally changed the default row format to DYNAMIC, utf8mb4 with large key prefix can be used without dumping the default engine and the row format explicitly. So now is a good time to make the default engine is omitted. Before: ```ruby create_table "accounts", options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci", force: :cascade do |t| end ``` After: ```ruby create_table "accounts", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t| end ``` To entirely omit `:options` option to make schema agnostic, I've added `:charset` and `:collation` table options to exclude `CHARSET` and `COLLATE` from `:options`. Fixes #26209. Closes #29472. See also #33608, #33853, and #34742.
-
由 David Heinemeier Hansson 提交于
-
由 Eugene Kenny 提交于
cd31e113 switched to passing options as keyword arguments, which always creates a new hash. 9e4ff29f removed a now-unnecessary call to `dup`, since the options could no longer be accidentally mutated. a55620f3 switched back to passing options as a positional argument for Ruby < 2.7, but didn't restore the call to `dup`, which meant that the same options hash was now passed with every method call and mutations leaked from one call to another.
-
由 player1 提交于
Co-authored-by: NAnton Topchii <player1@infinitevoid.net>
-
由 Ryuta Kamizono 提交于
`joins_values` is already `compact_blank!`ed, so `blank?` check is entirely redundant.
-
由 Ryuta Kamizono 提交于
Deprecate aggregations with group by duplicated fields
-
由 Ryuta Kamizono 提交于
We've learned that `merge` causes duplicated multiple values easily, so if we missed to deduplicate the values, it will cause weird behavior like #38052, #39171. I've investigated the deduplication for the values, at least that had existed since Rails 3.0. https://github.com/rails/rails/commit/bed9179aa1496f6d28891cf515af0d7e515ebbab Aggregations with group by multiple fields was introduced at Rails 3.1, but we missed the deduplication for the aggregation result, unlike the generated SQL. https://github.com/rails/rails/commit/a5cdf0b9eb860c4370ae5fde231e1b61f71b6b65 While the investigation, I've found that `annotate` is also missed the deduplication. I don't suppose this weird behavior is intended for both. So I'd like to deprecate the duplicated behavior in Rails 6.1, and will be deduplicated all multiple values in Rails 6.2. To migrate to Rails 6.2's behavior, use `uniq!(:group)` to deduplicate group fields. ```ruby accounts = Account.group(:firm_id) # duplicated group fields, deprecated. accounts.merge(accounts.where.not(credit_limit: nil)).sum(:credit_limit) # => { # [1, 1] => 50, # [2, 2] => 60 # } # use `uniq!(:group)` to deduplicate group fields. accounts.merge(accounts.where.not(credit_limit: nil)).uniq!(:group).sum(:credit_limit) # => { # 1 => 50, # 2 => 60 # } ```
-
由 Vipul A M 提交于
- Language changes around the deliver_later note. - Leave out "now", this is not a new feature anymore - Drops lots repetitive "just" and "simple"
-
由 Ryuta Kamizono 提交于
Deduplicate same clauses in `merge`
-
由 Ryuta Kamizono 提交于
Fix through association with source/through scope which has joins
-
由 Ryuta Kamizono 提交于
Related to #39328, #39358. For now, `merge` cannot override non-equality clauses, so non-equality clauses will easily be duplicated by `merge`. This deduplicates redundant same clauses in `merge`.
-
- 23 5月, 2020 4 次提交
-
-
由 Kasper Timm Hansen 提交于
Test Attached::Many in Attached::Many test
-
由 Jonathan Hefner 提交于
This exact test exists in `one_test.rb`. It was probably overlooked after being copied and pasted.
-
由 Kasper Timm Hansen 提交于
Reduce allocations in action_view cache expiry
-
由 Vinicius Stock 提交于
-
- 22 5月, 2020 5 次提交
-
-
由 Rafael França 提交于
Allow Erubi bufvar to be configured
-
由 Eugene Kenny 提交于
This reverts 8538dfdc, which broke the activemodel-serializers-xml gem. We can still get most of the benefit by applying the optimisation from 7b391977 to empty hashes as well as nil. This has the additional benefit of retaining the optimisation when the user passes an empty options hash.
-
由 Jonathan Hefner 提交于
This allows `render_in` components that compile their own templates to use their view context's current output buffer while a `with_output_buffer` block is being evaluated. Partially addresses #39377.
-
由 Ryuta Kamizono 提交于
If source/through scope references other tables in where/order, we should explicitly maintain joins in the scope, otherwise association queries will fail with referenced unknown column. Fixes #33525.
-
由 George Claghorn 提交于
-
- 21 5月, 2020 12 次提交
-
-
由 George Claghorn 提交于
They may be cached for existing apps upgrading to 6.1. Follows up on #34477.
-
由 Ryuta Kamizono 提交于
Fix through association to respect source scope for `includes`/`preload`
-
由 Ryuta Kamizono 提交于
Decoding JSON dates should respect newlines
-
由 Mads Ohm Larsen 提交于
-
由 Aaron Patterson 提交于
This fixes tests for missing backtraces
-
由 Ryan Davis 提交于
Errors *should* output their stack. Somehow these tests were passing before. This clarifies all states (skip/fail/error) and works against @tenderlove's patch.
-
由 Ryuta Kamizono 提交于
`reflection.scope` is not aware of all source scopes if the association is through association. It should use `reflection.join_scopes` for that. Fixes #39376.
-
由 Rafael França 提交于
Updates to nokogiri 1.10.9
-
由 Ricardo Trindade 提交于
-
由 Rafael França 提交于
Add `ActionDispatch::ActionableExceptions` to default middleware docs
-
由 jasonhl 提交于
-
由 Rafael Mendonça França 提交于
-
- 20 5月, 2020 3 次提交
-
-
由 Aaron Patterson 提交于
Before #39304 was merged, backtraces would look like this: ``` $ be ruby -I lib:test test/controller/request_forgery_protection_test.rb -n test_ignores_trailing_slash_during_generation Run options: -n test_ignores_trailing_slash_during_generation --seed 22205 E Error: PerFormTokensControllerTest#test_ignores_trailing_slash_during_generation: NoMethodError: undefined method `have_cookie_jar?' for #<Object:0x00007f9ce19b9620> /Users/aaron/git/rails/actionpack/lib/action_controller/test_case.rb:522:in `ensure in process' /Users/aaron/git/rails/actionpack/lib/action_controller/test_case.rb:542:in `process' /Users/aaron/git/rails/actionpack/lib/action_controller/test_case.rb:395:in `get' test/controller/request_forgery_protection_test.rb:1005:in `test_ignores_trailing_slash_during_generation' rails test test/controller/request_forgery_protection_test.rb:1004 Finished in 0.213230s, 4.6898 runs/s, 0.0000 assertions/s. 1 runs, 0 assertions, 0 failures, 1 errors, 0 skips ``` After #39304 was merged they look like this: ``` $ be ruby -I lib:test test/controller/request_forgery_protection_test.rb -n test_ignores_trailing_slash_during_generation Run options: -n test_ignores_trailing_slash_during_generation --seed 62892 E Error: PerFormTokensControllerTest#test_ignores_trailing_slash_during_generation: NoMethodError: undefined method `have_cookie_jar?' for #<Object:0x00007fa6d60193c8> rails test test/controller/request_forgery_protection_test.rb:1004 Finished in 0.211953s, 4.7180 runs/s, 0.0000 assertions/s. 1 runs, 0 assertions, 0 failures, 1 errors, 0 skips ``` This patch reverts the part of #39304 that removes the backtrace.
-
由 Ryuta Kamizono 提交于
Fixes #39088.
-
由 Eugene Kenny 提交于
Resolve conflict between counter cache and optimistic locking
-