- 18 10月, 2019 1 次提交
-
-
由 Ryuta Kamizono 提交于
Fixed performance regression introduced MySQL 8.0
-
- 20 9月, 2019 1 次提交
-
-
由 Ryuta Kamizono 提交于
-
- 09 9月, 2019 1 次提交
-
-
由 Ryuta Kamizono 提交于
Clear query cache when insert all is used
-
- 29 8月, 2019 2 次提交
-
-
由 Carlos Antonio da Silva 提交于
-
由 Eileen M. Uchitelle 提交于
Call `while_preventing_writes` from `connected_to`
-
- 23 8月, 2019 1 次提交
-
-
由 Ryuta Kamizono 提交于
Improve MySQL error detection
-
- 17 8月, 2019 1 次提交
-
-
由 Rafael Mendonça França 提交于
-
- 30 7月, 2019 3 次提交
-
-
由 Ryuta Kamizono 提交于
Preserve user supplied joins order as much as possible
-
由 Ryuta Kamizono 提交于
[ci skip]
-
由 Ryuta Kamizono 提交于
This was incorrectly added at 06401bb3.
-
- 28 7月, 2019 2 次提交
- 27 7月, 2019 1 次提交
-
-
由 Eileen M. Uchitelle 提交于
Allow separate database env variables per-connection
-
- 26 7月, 2019 1 次提交
-
-
由 Rafael Mendonça França 提交于
Add a warning for enum elements with 'not_' prefix.
-
- 23 7月, 2019 2 次提交
-
-
由 Rafael Mendonça França 提交于
Make currency symbols optional for money column type in PostgreSQL
-
由 Rafael Mendonça França 提交于
-
- 09 7月, 2019 2 次提交
-
-
-
由 Guilherme Mansur 提交于
When SQLite connects it will silently create a database if the database does not exist. This behaviour causes different issues because of inconsistent behaviour between adapters: #36383, #32914. This commit adds a `database_exists?` method as a way to check the database without creating it. This is a stepping stone to fully resolving the above issues.
-
- 17 6月, 2019 1 次提交
-
-
由 Ryuta Kamizono 提交于
PostgreSQL: Fix GROUP BY with ORDER BY virtual count attribute
-
- 15 6月, 2019 1 次提交
-
-
由 Eileen M. Uchitelle 提交于
Add support for multiple databases to `rails db:abort_if_pending_migrations`
-
- 14 6月, 2019 1 次提交
-
-
由 jeffdoering 提交于
* Make ActiveRecord `ConnectionPool.connections` thread-safe. ConnectionPool documentation is clear on the need to synchronize access to @connections but also states that public methods do not require synchronization. Existing code exposed @connections directly via attr_reader. The fix uses synchronize() to lock @connections then returns a copy to the caller using Array.dup(). Includes comments on the connections method that thread-safe access to the connections array does not imply thread-safety of accessing methods on the actual connections. Adds a test-case that modifies the pool using a supported method in one thread while a second thread accesses pool.connections. The test fails without this patch. Fixes #36465. * Update activerecord/test/cases/connection_pool_test.rb [jeffdoering + Rafael Mendonça França]
-
- 05 6月, 2019 1 次提交
-
-
由 Ryuta Kamizono 提交于
Fix sqlite3 collation parsing when using decimal columns.
-
- 03 6月, 2019 1 次提交
-
-
由 Ryuta Kamizono 提交于
Fix invalid schema dump when primary key column has a comment
-
- 02 6月, 2019 1 次提交
-
-
由 Ryuta Kamizono 提交于
Fix table comment also being applied to the primary key column
-
- 27 4月, 2019 1 次提交
-
-
由 Ryuta Kamizono 提交于
Fix merging left_joins to maintain its own `join_type` context
-
- 25 4月, 2019 2 次提交
-
-
由 Rafael Mendonça França 提交于
-
由 Abhay Nikam 提交于
-
- 19 4月, 2019 1 次提交
-
-
由 Ryuta Kamizono 提交于
`where.not` with polymorphic association is partly fixed incidentally at 213796fb (refer #33493, #26207, #17010, #16983, #14161), and I've added test case e9ba12f7 to avoid lose that fix accidentally in the future. In Rails 5.2, `where.not(polymorphic: object)` works as expected as NAND, but `where.not(polymorphic_type: object.class.polymorphic_name, polymorphic_id: object.id)` still unexpectedly works as NOR. To will make `where.not` working desiredly as NAND in Rails 6.1, this deprecates `where.not` working as NOR. If people want to continue NOR conditions, we'd encourage to them to `where.not` each conditions manually. ```ruby all = [treasures(:diamond), treasures(:sapphire), cars(:honda), treasures(:sapphire)] assert_equal all, PriceEstimate.all.map(&:estimate_of) ``` In Rails 6.0: ```ruby sapphire = treasures(:sapphire) nor = all.reject { |e| e.estimate_of_type == sapphire.class.polymorphic_name }.reject { |e| e.estimate_of_id == sapphire.id } assert_equal [cars(:honda)], nor without_sapphire = PriceEstimate.where.not( estimate_of_type: sapphire.class.polymorphic_name, estimate_of_id: sapphire.id ) assert_equal nor, without_sapphire.map(&:estimate_of) ``` In Rails 6.1: ```ruby sapphire = treasures(:sapphire) nand = all - [sapphire] assert_equal [treasures(:diamond), cars(:honda)], nand without_sapphire = PriceEstimate.where.not( estimate_of_type: sapphire.class.polymorphic_name, estimate_of_id: sapphire.id ) assert_equal nand, without_sapphire.map(&:estimate_of) ``` Resolves #31209.
-
- 17 4月, 2019 1 次提交
-
-
由 Lachlan Sylvester 提交于
Cache versioning enables the same cache key to be reused when the object being cached changes by moving the volatile part of the cache key out of the cache key and into a version that is embedded in the cache entry. This is already occurring when the object being cached is an `ActiveRecord::Base`, but when caching an `ActiveRecord::Relation` we are currently still putting the volatile information (max updated at and count) as part of the cache key. This PR moves the volatile part of the relations `cache_key` into the `cache_version` to support recycling cache keys for `ActiveRecord::Relation`s.
-
- 16 4月, 2019 2 次提交
-
-
由 Ryuta Kamizono 提交于
Currently the rollback only restores primary key value, `new_record?`, `destroyed?`, and `frozen?`. Since the `save` clears current dirty attribute states, retrying save after rollback will causes no change saved if partial writes is enabled (by default). This makes `remember_transaction_record_state` remembers original values then restores dirty attribute states after rollback. Fixes #15018. Fixes #30167. Fixes #33868. Fixes #33443. Closes #33444. Closes #34504.
-
由 Ryuta Kamizono 提交于
[ci skip]
-
- 15 4月, 2019 1 次提交
-
-
由 Yoshiyuki Kinjo 提交于
We can revert migrations using `change_column_comment` or `change_table_comment` at current master. However, results are not what we expect: comments are remained in new status. This change tells previous comment to these methods in a way like `change_column_default`.
-
- 12 4月, 2019 1 次提交
-
-
由 Ryuta Kamizono 提交于
Regardless of a record isn't saved (e.g. validation is failed), `after_commit` / `after_rollback` callbacks are invoked for now. To fix the issue, this adds a record to the current transaction only when a record is actually saved. Fixes #29747. Closes #29833.
-
- 07 4月, 2019 1 次提交
-
-
由 Ryuta Kamizono 提交于
When I've added new `:size` option in #35071, I've found that invalid `:limit` and `:precision` raises `ActiveRecordError` unlike other invalid options. I think that is hard to distinguish argument errors and statement invalid errors since the `StatementInvalid` is a subclass of the `ActiveRecordError`. https://github.com/rails/rails/blob/c9e4c848eeeb8999b778fa1ae52185ca5537fffe/activerecord/lib/active_record/errors.rb#L103 ```ruby begin # execute any migration rescue ActiveRecord::StatementInvalid # statement invalid rescue ActiveRecord::ActiveRecordError, ArgumentError # `ActiveRecordError` except `StatementInvalid` is maybe an argument error end ``` I'd say this is the inconsistency worth fixing. Before: ```ruby add_column :items, :attr1, :binary, size: 10 # => ArgumentError add_column :items, :attr2, :decimal, scale: 10 # => ArgumentError add_column :items, :attr3, :integer, limit: 10 # => ActiveRecordError add_column :items, :attr4, :datetime, precision: 10 # => ActiveRecordError ``` After: ```ruby add_column :items, :attr1, :binary, size: 10 # => ArgumentError add_column :items, :attr2, :decimal, scale: 10 # => ArgumentError add_column :items, :attr3, :integer, limit: 10 # => ArgumentError add_column :items, :attr4, :datetime, precision: 10 # => ArgumentError ```
-
- 05 4月, 2019 1 次提交
-
-
由 Ryuta Kamizono 提交于
Follow-up of 5c71000d, #29834, and #30271. Currently, preloading and eager loading are not to be affected by scoping, with the exception of `unscoped`. But non eager loaded association access is still affected by scoping. Although this is a breaking change, the association loading will work consistently whether preloaded / eager loaded or not. Before: ```ruby Post.where("1=0").scoping do Comment.find(1).post # => nil Comment.preload(:post).find(1).post # => #<Post id: 1, ...> Comment.eager_load(:post).find(1).post # => #<Post id: 1, ...> end ``` After: ```ruby Post.where("1=0").scoping do Comment.find(1).post # => #<Post id: 1, ...> Comment.preload(:post).find(1).post # => #<Post id: 1, ...> Comment.eager_load(:post).find(1).post # => #<Post id: 1, ...> end ``` Fixes #34638. Fixes #35398.
-
- 03 4月, 2019 5 次提交
-
-
由 Kasper Timm Hansen 提交于
-
由 Roberto Miranda 提交于
-
由 Ryuta Kamizono 提交于
* s/Postgres/PostgreSQL/ * s/MYSQL/MySQL/, s/Mysql/MySQL/ * s/Sqlite/SQLite/ Replaced all newly added them after 6089b314.
-
由 Ryuta Kamizono 提交于
-
由 David Heinemeier Hansson 提交于
Add `after_save_commit` callback as shortcut for `after_commit :hook, on: [ :create, :update ]`. (#35804)
-