- 16 5月, 2020 4 次提交
-
-
由 Ryuta Kamizono 提交于
#38354 is caused by #36304, to fix invalid joins order for through associations. Actually passing Arel joins to `joins` is not officially supported unlike string joins, and also Arel joins could be easily converted to string joins by `to_sql`. But I'd not intend to break existing apps without deprecation cycle, so I've changed to mark only implicit joins as leading joins, to maintain the original joins order for user supplied Arel joins. Fixes #38354.
-
由 John Hawthorn 提交于
Stop creating too many test databases
-
由 Aaron Patterson 提交于
Fix `AR::Relation#where_values_hash` with `HomogeousIn`:
-
由 Lee Quarella 提交于
Issue #39291 In https://github.com/rails/rails/pull/38893 parallel test worker ids were changed to `SecureRandom.uuid` to keep track of inflight work across distributed instances, but negelected to change the worker callbacks to match. This caused a new set of unique test databases are created with every test run. This commit makes the appropriate change to worker callbacks so only one set of of parallel test databases are created.
-
- 15 5月, 2020 9 次提交
-
-
由 Edouard CHIN 提交于
- Calling `Blog.where(title: ['foo', 'bar']).where_values_hash` now returns an empty hash. This is a regression since 72fd0bae . `Arel::Node::HomogeousIn` isn't a `EqualityNode`, the `WhereClause` didn't had a case for this. I decide to not make `HomogeousIn` inherit from `EqualityNode`, because there is a comment questioning it for `In` https://github.com/rails/rails/blob/57d926a78a6968b9268f4ec1acde608132a1c920/activerecord/lib/arel/nodes.rb#L31 Intead I just modified the `WhereClause` case and implemented `right` on the node which is needed by `where_value_hash` https://github.com/rails/rails/blob/57d926a78a6968b9268f4ec1acde608132a1c920/activerecord/lib/active_record/relation/where_clause.rb#L59
-
由 Ryuta Kamizono 提交于
Type cast aggregations values for table name unqalified column in joins tables
-
由 Ryuta Kamizono 提交于
Follow up of #39292 and #39259.
-
由 Ryuta Kamizono 提交于
Type cast `pluck` values for table name unqalified column in joins tables
-
由 Ryuta Kamizono 提交于
-
由 Ryuta Kamizono 提交于
Allow define scope for Ruby reserved keywords
-
由 Ryuta Kamizono 提交于
Support native RENAME COLUMN syntax for MySQL
-
由 Ryuta Kamizono 提交于
Follow up to #39264, and fixes demonstrated case in #39290. If the column has no type caster and the model don't know the attribute, let's will attempt to lookup cast type from join dependency tree.
-
由 Jonathan Hefner 提交于
Fix wording in rail/engine.rb
-
- 14 5月, 2020 15 次提交
-
-
由 George Claghorn 提交于
References dfb5a82b.
-
由 Ryuta Kamizono 提交于
For now argument forwarding doesn't allow some keywords like `true` as a method name. To bypass the issue, fallback to `define_method` if method names are Ruby reserved keywords. https://bugs.ruby-lang.org/issues/16854 ```ruby class Works def true(*args) puts(*args) end end Works.new.true 1, 2, 3 # => 1, 2, 3 class WontWork def true(...) puts(...) end end ``` ``` % ruby a.rb a.rb:12: syntax error, unexpected ..., expecting ')' def true(...) a.rb:13: unexpected ... a.rb:15: syntax error, unexpected `end', expecting end-of-input ```
-
由 Ryuta Kamizono 提交于
MySQL 8.0.3 (and MariaDB 10.5.2) now supports native RENAME COLUMN syntax. https://dev.mysql.com/doc/relnotes/mysql/8.0/en/news-8-0-3.html#mysqld-8-0-3-sql-syntax https://mariadb.com/kb/en/alter-table/#rename-column
-
由 Ryuta Kamizono 提交于
Update `supports_rename_index?` version for MariaDB
-
由 Ryuta Kamizono 提交于
Looks like the CI failure is caused by rename index on a foreign key constraint. https://buildkite.com/rails/rails/builds/69099#1b008fd1-1d2f-4c87-934a-8cdfd6e42c67/1022-2096
-
由 Ryuta Kamizono 提交于
-
由 Haroon Ahmed 提交于
-
由 Ryuta Kamizono 提交于
Improve performance for loaded association's `first`
-
由 Ryuta Kamizono 提交于
Fix left joins order when merging multiple left joins from different associations
-
由 Ryuta Kamizono 提交于
Fix `pluck` to correctly type cast same column names and association columns
-
由 Ryuta Kamizono 提交于
Casting aggregated value takes attribute type precedence over database type
-
由 Ryuta Kamizono 提交于
Remove Indexer class from Rails Guide generator
-
由 Ryuta Kamizono 提交于
Follow up to #39255, #39039. One of the purpose of this was to unify the behavior between the databases. Original code was: ```ruby type = result.column_types.fetch(column_alias) do type_for(column_name) end ``` The code will attempt looking up type from `column_types`, then fallback to attribute types, so I supposed the code was originally intended to cast a value by the database types. But now, most modern clients will already return casted values, and no longer use `column_types`, except Postgres. As a result, now most adapter accidentally fallback to attribute types. Since casted by attribute types sometimes doesn't return numeric values, I've unified the behavior to use database types consistently in #39039. But later, I've learned that attribute types have important settings like time zone aware attributes (#39255), and some existing code relying on attribute types over database types (#39271). I've changed all aggregated values are casted by attribute types. Fixes #39271.
-
由 Lukas_Skywalker 提交于
This commit removes the orphaned Indexer class from the Rails Guide generator. The indexer was removed in 2012 during the move from Textile to Markdown in commit 5e2866cc.
-
由 eileencodes 提交于
I can't for the life of me reproduce the failures occurring on buildkite but I beleive this is the fix. We need to only run this on sqlite3 because we are using a sqlite3 database.
-
- 13 5月, 2020 12 次提交
-
-
由 Ryuta Kamizono 提交于
Delegate to scope values (e.g. `offset_value`, `order_values`) is slow. We can avoid that if records are already loaded. ```ruby class Post < ActiveRecord::Base has_many :comments end class Comment < ActiveRecord::Base belongs_to :post has_many :likes end class Like < ActiveRecord::Base belongs_to :post end 10.times { Post.create! } 30.times { |i| Comment.create!(post_id: 1 + i % 10) } 150.times { |i |Like.create!(comment_id: 1 + i % 30) } post = Post.includes(comments: :likes).last result = Benchmark.measure do 100.times { post.comments.each { |c| c.likes.first.id } } end puts puts result ``` Before: ``` 0.013542 0.000582 0.014124 ( 0.014125) ``` After: ``` 0.000938 0.000017 0.000955 ( 0.000952) ``` Fixes #38252.
-
由 eileencodes 提交于
This moves the previous test into the old test and reuses the connection that that test establishes rather than requiring we muck with temporary connection pool. The change here is more correct than the previous code since we're establishing new connections we should be checking the newly established reading and writing connections are the same, not checking against the existing ActiveRecord::Base.connection. The test here also most closely emulates a real application using multiple databases. Co-authored-by: NJohn Crepezzi <john.crepezzi@gmail.com>
-
由 Santiago Bartesaghi 提交于
-
由 Ryuta Kamizono 提交于
#38597 is caused by #35864. To reproduce this issue, at least it is required four different models and three left joins from different relations. When merging a relation from different model, new stashed (left) joins should be placed before existing stashed joins, but #35864 had broken that expectation if left joins are stashed multiple times. This fixes that stashed left joins order as expected. Fixes #38597.
-
由 Ryuta Kamizono 提交于
That issues are caused by using only the model's cast types on the relation. To fix that issues, use the attribute's type caster takes precedence over the model's cast types on the relation. Fixes #35232. Fixes #36042. Fixes #37484.
-
由 Ryuta Kamizono 提交于
-
由 Ryuta Kamizono 提交于
Association look up requires association class is loaded especially for through association. Just apply that look up only in aggregation column for now.
-
由 Ryuta Kamizono 提交于
Fix type casting aggregated values on association's attributes
-
由 Ryuta Kamizono 提交于
Follow up of #39255. Previously aggregation functions only use the model's attribute types on the relation for type cast, this will be looking up association's attribute and type caster if a column name is table name qualified. Fixes #39248.
-
由 Aaron Patterson 提交于
Add did you mean ssupport to UrlGeneration errors
-
由 Eileen M. Uchitelle 提交于
Revert "Remove deprecated `ActionMailer::DeliveryJob` and `ActionMailer::Parameterized::DeliveryJob`
-
由 Eugene Kenny 提交于
Followup to b3102205.
-