- 23 11月, 2017 1 次提交
-
-
由 T.J. Schuck 提交于
[ci skip]
-
- 20 11月, 2017 1 次提交
-
-
由 Ryuta Kamizono 提交于
These extra `spawn` are called via `klass.all` and `klass.all` is called everywhere in the internal. Avoiding the extra `spawn` makes` klass.all` 30% faster for STI classes. https://gist.github.com/kamipo/684d03817a8115848cec8e8b079560b7 ``` Warming up -------------------------------------- fast relation 4.410k i/100ms slow relation 3.334k i/100ms Calculating ------------------------------------- fast relation 47.373k (± 5.2%) i/s - 238.140k in 5.041836s slow relation 35.757k (±15.9%) i/s - 176.702k in 5.104625s Comparison: fast relation: 47373.2 i/s slow relation: 35756.7 i/s - 1.32x slower ```
-
- 18 11月, 2017 1 次提交
-
-
由 Matthew Draper 提交于
Use whatever adapter-provided means we have available to ensure forked children don't send quit/shutdown/goodbye messages to the server on connections that belonged to their parent.
-
- 17 11月, 2017 1 次提交
-
-
由 Ryuta Kamizono 提交于
Currently `_create_record` and `_update_record` in `Persistence` are creating extra `unscoped` and calling `build_arel` in the relation. But `compile_insert` and `compile_update` can be done without those expensive operation for `SelectManager` creation. So I moved the implementation to `Persistence` to avoid creating extra relation and refactored to avoid calling `build_arel`. https://gist.github.com/kamipo/8ed73d760112cfa5f6263c9413633419 Before: ``` Warming up -------------------------------------- _update_record 150.000 i/100ms Calculating ------------------------------------- _update_record 1.548k (±12.3%) i/s - 7.650k in 5.042603s ``` After: ``` Warming up -------------------------------------- _update_record 201.000 i/100ms Calculating ------------------------------------- _update_record 2.002k (±12.8%) i/s - 9.849k in 5.027681s ``` 30% faster for STI classes.
-
- 15 11月, 2017 2 次提交
-
-
由 bogdanvlviv 提交于
-
由 Rich 提交于
* Add a #populate method to migrations * Address rubocop issues * Rename to #up_only and use #execute in the examples intead of the model * Update CHANGELOG [Rich Daley & Rafael Mendonça França]
-
- 14 11月, 2017 4 次提交
-
-
由 Nikolai B 提交于
Make it clear that `exists?` can be chained onto a relation
-
由 Yuji Yaginuma 提交于
Currently the environment is not loaded in some db tasks. Therefore, if use encrypted secrets values in `database.yml`, `read_encrypted_secrets` will not be true, so the value can not be used correctly. To fix this, added `environment` as dependency of `load_config`. It also removes explicit `environment` dependencies that are no longer needed. Fixes #30717
-
由 Sean Griffin 提交于
The documentation claims that given values go through "normal AR type casting and serialization", which to me implies `serialize(cast(value))`, not just serialization. The docs were changed to use this wording in #22492. The tests I cited in that PR (which is the same test modified in this commit), is worded in a way that implies it should be using `cast` as well. It's possible that I originally meant "normal type casting" to imply just the call to `serialize`, but given that `update_all(archived: params['archived'])` seems to be pretty common, I'm inclined to make this change as long as no tests are broken from it.
-
由 Jon Moss 提交于
If there are any ignored columns, we will now list out all columns we want to be returned from the database. Includes a regression test.
-
- 13 11月, 2017 1 次提交
-
-
由 Ryuta Kamizono 提交于
Add new error class `StatementTimeout` which will be raised when statement timeout exceeded (#31129) We are sometimes using The MAX_EXECUTION_TIME hint for MySQL depending on the situation. It will prevent catastrophic performance down by wrong performing queries. The new error class `StatementTimeout` will make to be easier to handle that case. https://dev.mysql.com/doc/refman/5.7/en/optimizer-hints.html#optimizer-hints-execution-time
-
- 11 11月, 2017 3 次提交
-
-
由 Ryuta Kamizono 提交于
Follow up of #30360.
-
由 Ryuta Kamizono 提交于
Attribute modules (`Attribute`, `Attributes`, `AttributeSet`) uses `Type`, but referencing `Type` before the modules still fail. ``` % ./bin/test -w test/cases/attribute_test.rb -n test_with_value_from_user_validates_the_value Run options: -n test_with_value_from_user_validates_the_value --seed 31876 E Error: ActiveModel::AttributeTest#test_with_value_from_user_validates_the_value: NameError: uninitialized constant ActiveModel::AttributeTest::Type /Users/kamipo/src/github.com/rails/rails/activemodel/test/cases/attribute_test.rb:233:in `block in <class:AttributeTest>' bin/test test/cases/attribute_test.rb:232 Finished in 0.002985s, 335.0479 runs/s, 335.0479 assertions/s. 1 runs, 1 assertions, 0 failures, 1 errors, 0 skips ``` Probably we need more autoloading at least `Type`.
-
由 Ryuta Kamizono 提交于
`joins_values.partition` will break joins values order. It should be kept as user intended order. Fixes #15488.
-
- 10 11月, 2017 4 次提交
-
-
由 Ryuta Kamizono 提交于
-
由 Ryuta Kamizono 提交于
Fixes #21577.
-
由 Ryuta Kamizono 提交于
They are only different by one line of code which doesn't deserve a hierarchy of 7 classes. Closes #31079. [Ryuta Kamizono & Bogdan Gusiev]
-
由 Lisa Ugray 提交于
Use these to back the attributes API. Stop automatically including ActiveModel::Dirty in ActiveModel::Attributes, and make it optional.
-
- 09 11月, 2017 14 次提交
-
-
由 Brent Wheeldon 提交于
This fixes an issue where competing threads deadlock each other. - Thread A holds the load interlock but is blocked on getting the DB lock - Thread B holds the DB lock but is blocked on getting the load interlock (for example when there is a `Model.transaction` block that needs to autoload) This solution allows for dependency loading in other threads while a thread is waiting to acquire the DB lock. Fixes #31019
-
由 Ben Toews 提交于
-
由 Ben Toews 提交于
-
由 Ben Toews 提交于
-
由 Ben Toews 提交于
use << instead of #concat in #reverse_sql_order because we might be working with Arel SQL literator which overrides #concat
-
由 Ben Toews 提交于
-
由 Ben Toews 提交于
-
由 Ben Toews 提交于
-
由 Ben Toews 提交于
-
由 Ben Toews 提交于
-
由 Ben Toews 提交于
-
由 Ben Toews 提交于
-
由 Ben Toews 提交于
-
由 Ben Toews 提交于
-
- 08 11月, 2017 2 次提交
-
-
由 Ryuta Kamizono 提交于
-
由 Ryuta Kamizono 提交于
`through_reflection` and `source_reflection` are used only in the class.
-
- 07 11月, 2017 3 次提交
-
-
由 Ryuta Kamizono 提交于
`associated_records_by_owner` had returned customizing result before calling `associate_records_to_owner` for through association subclasses. Since #22115, `associate_records_to_owner` is called in the method and not returned owner and result pairs. Removing the method will reduce method call and block call nesting.
-
由 bogdanvlviv 提交于
Ensure that `bin/rails db:migrate` with specified `VERSION` reverts all migrations only if `VERSION` is `0`. Raise error if target migration doesn't exist.
-
由 Keenan Brock 提交于
``` [NoMethodError]: undefined method `state' for nil:NilClass Method:[rescue in block in refresh] ``` In `within_new_transaction`, there is the possibility that `begin_transaction` returns a `nil`. (i.e.: so `transaction = nil`) So this method is checking `transaction` for nil in 2 spots. Unfortunately, there is one line that is not checking `transaction` for `nil` That line, `commit_transaction`, throws an exception for us in AR 5.0.0.1 The problem with the method is finally realized in the error checking itself. it calls `transaction.state` (i.e.: nil.state) and that is the final exception raised. The actual underlying (user) issue is hidden by this line. Solution is test transaction for nil.
-
- 06 11月, 2017 3 次提交
-
-
由 Bogdan Gusiev 提交于
-
由 Ryuta Kamizono 提交于
A relation includes `klass`, so it can not be used as it is if current class is different from `current_scope.klass`. It should be created new relation by current class to respect the klass and STI constraint. Fixes #17603. Fixes #23576.
-
由 Ryuta Kamizono 提交于
This is partially fixed by e617fb57 when through association has already loaded. Otherwise, second level through association should respect `preload_scope`. Fixes #30242. Closes #30076. [Ryuta Kamizono & CicholGricenchos]
-