- 03 5月, 2020 5 次提交
-
-
由 Eugene Kenny 提交于
Since 901d62c5, associations can only be autosaved once: after a record has been saved, `@new_record_before_save` will always be false. This assumes that records only transition to being persisted once, but there are two cases where it happens multiple times: when the transaction that saved the record is rolled back, and when the persisted record is later duplicated.
-
由 Xavier Noria 提交于
Fix `modules_for_helpers` to will raise `MissingHelperError`
-
由 Ryuta Kamizono 提交于
-
由 Ryuta Kamizono 提交于
Deprecate marshalling load from legacy attributes format
-
由 Ryuta Kamizono 提交于
-
- 02 5月, 2020 18 次提交
-
-
由 Xavier Noria 提交于
Motivation is twofold: * We are gradually removing `require_dependency` from the framework. * Let `helper` work if `config.add_autoload_paths_to_load_path` is disabled. Co-authored-by: NJean Boussier <jean.boussier@gmail.com>
-
由 Xavier Noria 提交于
Let's bump Zeitwerk in preparation for Rails 6.1. With Zeitwerk 2.3, applications can enable reloading and eager loading at the same time. As of this writing, Rails does not implement that logic, but if we do we know the dependency is in place to support it. Zeitwerk minor releases are backwards compatible, should be a seamlessly upgrade.
-
由 Ryuta Kamizono 提交于
Since #31827, marshalling attributes hash format is changed to improve performance because materializing lazy attribute hash is too expensive. In that time, we had kept an ability to load from legacy attributes format, since that performance improvement is backported to 5-1-stable and 5-0-stable. Now all supported versions will dump attributes as new format, the backward compatibity should no longer be needed.
-
由 Ryuta Kamizono 提交于
Fix `minimum` and `maximum` on non numeric column
-
由 Ryuta Kamizono 提交于
Deprecate passing a column to `type_cast`
-
由 Ryuta Kamizono 提交于
I supposed all aggregation functions will return numeric result in #39039, but that assumption was incorrect for `minimum` and `maximum`, if an aggregated column is non numeric type. I've restored type casting aggregated result for `minimum` and `maximum`. Fixes #39110.
-
由 Ryuta Kamizono 提交于
The type information for type casting is entirely separated to type object, so if anyone does passing a column to `type_cast` in Rails 6, they are likely doing something wrong. See the comment for more details: https://github.com/rails/rails/blob/28d815b89487ce4001a3f6f0ab684e6f9c017ed0/activerecord/lib/active_record/connection_adapters/abstract/quoting.rb#L33-L42 This also deprecates passing legacy binds (an array of `[column, value]` which is 4.2 style format) to query methods on connection. That legacy format was kept for backward compatibility, instead of that, I've supported casted binds format (an array of casted values), it is easier to construct binds than existing two binds format.
-
由 Ryuta Kamizono 提交于
-
由 Ryuta Kamizono 提交于
Lock benchmark-ips version < 2.8
-
由 Ryuta Kamizono 提交于
Looks like "File does not exist: benchmark/ips/stats/stats_metric" is caused by benchmark-ips 2.8.0. https://buildkite.com/rails/rails/builds/68586#d77847d6-b3f5-4fd9-af9e-45f465c9d801/940-965 https://buildkite.com/rails/rails/builds/68586#e2037c59-a695-41ff-9040-c8ee74fa7c16/940-965
-
由 Ryuta Kamizono 提交于
Looks like benchmark-ips 2.8.0 is broken. https://buildkite.com/rails/rails/builds/68583#cefd24fb-33e5-4967-ab5d-f52c46700cd7/1879-1934
-
由 Ryuta Kamizono 提交于
Remove internal `without_transaction_enrollment` callbacks
-
由 Ryuta Kamizono 提交于
Avoid quite useless loop in `find_by_sql`
-
由 Eileen M. Uchitelle 提交于
[Doc] Add mention to shared section in `config_for` docs [ci skip]
-
由 eileencodes 提交于
-
由 eileencodes 提交于
We were testing the behavior of out of range ID's on where queries but not when out of range slugs are converted to ID's.
-
由 Rafael França 提交于
Also batch attribute readers and writers
-
由 Rafael Mendonça França 提交于
-
- 01 5月, 2020 11 次提交
-
-
由 Ryuta Kamizono 提交于
I've found the internal `without_transaction_enrollment` callbacks which have not been newly used over five years, when I tried to work reverting #9068 (https://github.com/rails/rails/pull/36049#issuecomment-487318060). I think that we will never make that callbacks public, since the mechanism of `without_transaction_enrollment` is too implementation specific, at least before #9068, records in a transaction had enrolled all into the transaction. That callbacks was introduced at #18936 to make `touch_later` #19324, but I think that the internal callbacks is overkill to just make the `touch_later` only, and invoking the extra callbacks also have a little overhead even if we haven't used that. So I think we can remove the internal callbacks for now, until we will come up with a good use for that callbacks.
-
由 Alberto Almagro 提交于
37913 added the possibility to deeply merge configurations by grouping them within a shared section. This powerful alternative was not reflected in any documentation, which made my team think it was not possible until I found out this feature after looking at the source code. This patch reflects this change in the documentation so that it is easier for other developers to know about this behavior.
-
由 Jean Boussier 提交于
-
由 Ryuta Kamizono 提交于
`column_types` is empty except PostgreSQL adapter, and `attribute_types.each_key { |k| column_types.delete k }` is also empty even if PostgreSQL adapter almost all case, so that code is quite useless. This improves performance for `find_by_sql` to avoid that useless loop as much as possible. ```ruby ActiveRecord::Schema.define do create_table :active_storage_blobs do |t| t.string :key, null: false t.string :filename, null: false t.string :content_type t.text :metadata t.string :service_name, null: false t.bigint :byte_size, null: false t.string :checksum, null: false t.datetime :created_at, null: false t.index [ :key ], unique: true end end class ActiveStorageBlob < ActiveRecord::Base end Benchmark.ips do |x| x.report("find_by") { ActiveStorageBlob.find_by(id: 1) } end ``` Before: ``` Warming up -------------------------------------- find_by 1.256k i/100ms Calculating ------------------------------------- find_by 12.595k (± 3.4%) i/s - 64.056k in 5.091599s ``` After: ``` Warming up -------------------------------------- find_by 1.341k i/100ms Calculating ------------------------------------- find_by 13.170k (± 3.5%) i/s - 67.050k in 5.097439s ``` To avoid column types loop for PostgreSQL adapter, this skips returning additional column types if a column has already been type casted by pg decoders. Fortunately this fixes #36186 partly for common types.
-
由 Ryuta Kamizono 提交于
-
由 Ryuta Kamizono 提交于
Remove useless type cast on aggregated value
-
由 Ryuta Kamizono 提交于
Update pg gem required version to 1.1
-
由 Ryuta Kamizono 提交于
Relying on the `Arel::Table.engine` is convenient if an app have only a single kind of database, but if not so, the global state is not always the same with the current connection.
-
由 Rafael França 提交于
Batch attribute methods definition
-
由 Jean Boussier 提交于
-
- 30 4月, 2020 5 次提交
-
-
由 Eugene Kenny 提交于
Add override of unary plus for `ActiveSupport::Duration`
-
由 Ryuta Kamizono 提交于
Deprecate `allowed_index_name_length` in `DatabaseLimits`
-
由 Roman Kushnir 提交于
```ruby (+ 1.second).class => ActiveSupport::Duration ``` Fixes #39079.
-
由 Xavier Noria 提交于
The less we depend on require_dependency, the better.
-
由 Ryuta Kamizono 提交于
`allowed_index_name_length` was used for internal temporary operations in SQLite3, since index name in SQLite3 must be globally unique and SQLite3 doesn't have ALTER TABLE feature (so it is emulated by creating temporary table with prefix). `allowed_index_name_length` was to reserve the margin for the prefix, but actually SQLite3 doesn't have a limitation for identifier name length, so the margin has removed at 36901e6e. Now `allowed_index_name_length` is no longer relied on by any adapter, so I'd like to remove the internal specific method which is no longer used.
-
- 29 4月, 2020 1 次提交
-
-
由 Xavier Noria 提交于
-