- 25 5月, 2020 4 次提交
-
-
由 Alexander Shemetovskiy 提交于
-
由 Ryuta Kamizono 提交于
And use `Symbol#[]` to strip suffix to avoid intermediate string allocation.
-
由 Ryuta Kamizono 提交于
Utilize Symbol#start_with? and #end_with?
-
由 Jonathan Hefner 提交于
Follow-up to #39155. Thanks to Symbol#start_with? and #end_with?, these calls no longer need to be prefixed with `.to_s`.
-
- 24 5月, 2020 21 次提交
-
-
由 Ryuta Kamizono 提交于
Update rubocop-performance gem and enable Performance/DeletePrefix and Performance/DeleteSuffix cops
-
由 Ryuta Kamizono 提交于
Allow relations with different SQL comments in the `or` method
-
由 sinsoku 提交于
An error occurs when you pass a relation with SQL comments to the `or` method. ```ruby class Post scope :active, -> { where(active: true).annotate("active posts") } end Post.where("created_at > ?", Time.current.beginning_of_month) .or(Post.active) ``` In order to work without `ArgumentError`, it changes the `or` method to ignore SQL comments in the argument. Ref: https://github.com/rails/rails/pull/38145#discussion_r363024376
-
由 Niklas Häusele 提交于
-
由 Ryuta Kamizono 提交于
ff45b9e9 had removed that limitation for `or`. [ci skip]
-
由 fatkodima 提交于
Update rubocop-performance gem and enable Performance/DeletePrefix and Performance/DeleteSuffix cops
-
由 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 6 次提交
-
-
由 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.
-