- 24 5月, 2020 6 次提交
-
-
由 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 13 次提交
-
-
由 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
-
由 Eugene Kenny 提交于
Satisfy Rubocop
-
由 Jonathan Hefner 提交于
Fixes offense: ``` actionpack/test/journey/router_test.rb:493:37: C: Style/HashSyntax: Use the new Ruby 1.9 hash syntax. options = options.merge(:_recall => recall) ^^^^^^^^^^^ ```
-
由 Aaron Lipman 提交于
Bump an Active Record instance's lock version after updating its counter cache. This avoids raising an unnecessary ActiveRecord::StaleObjectError upon subsequent transactions by maintaining parity with the corresponding database record's lock_version column.
-
由 Aaron Patterson 提交于
Journey is considered internal, and I would like to stop testing internals so that we are free to refactor. This commit just moves us up one more call frame with the goal if getting closer to a public API. Once we're up the stack high enough that we're testing a public API we can stop
-
由 Eugene Kenny 提交于
Unify raise_on_missing_translations for views and controllers
-
由 fatkodima 提交于
-
由 Rafael França 提交于
Add the configuration option for annotating templates with file names to the generated app
-
由 Rafael França 提交于
Clarify versioning strategy in maintenance policy
-
由 Anton Rieder 提交于
Not all releases are using `X.Y.Z`.
-
由 Eugene Kenny 提交于
Since 7b391977, `serializable_hash` allocates fewer objects when options is nil rather than empty.
-