activerecord 5.1.0 → 5.2.3
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of activerecord might be problematic. Click here for more details.
- checksums.yaml +5 -5
- data/CHANGELOG.md +596 -450
- data/MIT-LICENSE +1 -1
- data/README.rdoc +5 -5
- data/examples/performance.rb +2 -0
- data/examples/simple.rb +2 -0
- data/lib/active_record.rb +11 -4
- data/lib/active_record/aggregations.rb +6 -5
- data/lib/active_record/association_relation.rb +7 -5
- data/lib/active_record/associations.rb +77 -85
- data/lib/active_record/associations/alias_tracker.rb +23 -32
- data/lib/active_record/associations/association.rb +49 -35
- data/lib/active_record/associations/association_scope.rb +55 -55
- data/lib/active_record/associations/belongs_to_association.rb +30 -11
- data/lib/active_record/associations/belongs_to_polymorphic_association.rb +8 -8
- data/lib/active_record/associations/builder/association.rb +4 -7
- data/lib/active_record/associations/builder/belongs_to.rb +21 -8
- data/lib/active_record/associations/builder/collection_association.rb +1 -1
- data/lib/active_record/associations/builder/has_and_belongs_to_many.rb +3 -1
- data/lib/active_record/associations/builder/has_many.rb +2 -0
- data/lib/active_record/associations/builder/has_one.rb +2 -0
- data/lib/active_record/associations/builder/singular_association.rb +2 -0
- data/lib/active_record/associations/collection_association.rb +66 -53
- data/lib/active_record/associations/collection_proxy.rb +30 -73
- data/lib/active_record/associations/foreign_association.rb +2 -0
- data/lib/active_record/associations/has_many_association.rb +13 -2
- data/lib/active_record/associations/has_many_through_association.rb +37 -19
- data/lib/active_record/associations/has_one_association.rb +14 -1
- data/lib/active_record/associations/has_one_through_association.rb +13 -8
- data/lib/active_record/associations/join_dependency.rb +52 -96
- data/lib/active_record/associations/join_dependency/join_association.rb +22 -75
- data/lib/active_record/associations/join_dependency/join_base.rb +9 -8
- data/lib/active_record/associations/join_dependency/join_part.rb +9 -9
- data/lib/active_record/associations/preloader.rb +17 -37
- data/lib/active_record/associations/preloader/association.rb +53 -92
- data/lib/active_record/associations/preloader/through_association.rb +72 -73
- data/lib/active_record/associations/singular_association.rb +14 -16
- data/lib/active_record/associations/through_association.rb +27 -12
- data/lib/active_record/attribute_assignment.rb +2 -5
- data/lib/active_record/attribute_decorators.rb +3 -2
- data/lib/active_record/attribute_methods.rb +65 -24
- data/lib/active_record/attribute_methods/before_type_cast.rb +2 -0
- data/lib/active_record/attribute_methods/dirty.rb +33 -216
- data/lib/active_record/attribute_methods/primary_key.rb +10 -13
- data/lib/active_record/attribute_methods/query.rb +2 -0
- data/lib/active_record/attribute_methods/read.rb +9 -3
- data/lib/active_record/attribute_methods/serialization.rb +23 -0
- data/lib/active_record/attribute_methods/time_zone_conversion.rb +6 -8
- data/lib/active_record/attribute_methods/write.rb +22 -19
- data/lib/active_record/attributes.rb +7 -6
- data/lib/active_record/autosave_association.rb +15 -13
- data/lib/active_record/base.rb +2 -0
- data/lib/active_record/callbacks.rb +12 -6
- data/lib/active_record/coders/json.rb +2 -0
- data/lib/active_record/coders/yaml_column.rb +2 -0
- data/lib/active_record/collection_cache_key.rb +15 -11
- data/lib/active_record/connection_adapters/abstract/connection_pool.rb +120 -39
- data/lib/active_record/connection_adapters/abstract/database_limits.rb +7 -0
- data/lib/active_record/connection_adapters/abstract/database_statements.rb +192 -37
- data/lib/active_record/connection_adapters/abstract/query_cache.rb +13 -2
- data/lib/active_record/connection_adapters/abstract/quoting.rb +15 -25
- data/lib/active_record/connection_adapters/abstract/savepoints.rb +2 -0
- data/lib/active_record/connection_adapters/abstract/schema_creation.rb +15 -6
- data/lib/active_record/connection_adapters/abstract/schema_definitions.rb +65 -7
- data/lib/active_record/connection_adapters/abstract/schema_dumper.rb +31 -53
- data/lib/active_record/connection_adapters/abstract/schema_statements.rb +158 -87
- data/lib/active_record/connection_adapters/abstract/transaction.rb +66 -21
- data/lib/active_record/connection_adapters/abstract_adapter.rb +86 -98
- data/lib/active_record/connection_adapters/abstract_mysql_adapter.rb +126 -189
- data/lib/active_record/connection_adapters/column.rb +4 -2
- data/lib/active_record/connection_adapters/connection_specification.rb +17 -3
- data/lib/active_record/connection_adapters/determine_if_preparable_visitor.rb +13 -2
- data/lib/active_record/connection_adapters/mysql/column.rb +2 -0
- data/lib/active_record/connection_adapters/mysql/database_statements.rb +45 -15
- data/lib/active_record/connection_adapters/mysql/explain_pretty_printer.rb +2 -0
- data/lib/active_record/connection_adapters/mysql/quoting.rb +9 -10
- data/lib/active_record/connection_adapters/mysql/schema_creation.rb +5 -3
- data/lib/active_record/connection_adapters/mysql/schema_definitions.rb +7 -10
- data/lib/active_record/connection_adapters/mysql/schema_dumper.rb +30 -23
- data/lib/active_record/connection_adapters/mysql/schema_statements.rb +106 -1
- data/lib/active_record/connection_adapters/mysql/type_metadata.rb +2 -0
- data/lib/active_record/connection_adapters/mysql2_adapter.rb +8 -2
- data/lib/active_record/connection_adapters/postgresql/column.rb +30 -1
- data/lib/active_record/connection_adapters/postgresql/database_statements.rb +6 -32
- data/lib/active_record/connection_adapters/postgresql/explain_pretty_printer.rb +2 -0
- data/lib/active_record/connection_adapters/postgresql/oid.rb +3 -1
- data/lib/active_record/connection_adapters/postgresql/oid/array.rb +13 -1
- data/lib/active_record/connection_adapters/postgresql/oid/bit.rb +2 -0
- data/lib/active_record/connection_adapters/postgresql/oid/bit_varying.rb +2 -0
- data/lib/active_record/connection_adapters/postgresql/oid/bytea.rb +2 -0
- data/lib/active_record/connection_adapters/postgresql/oid/cidr.rb +2 -0
- data/lib/active_record/connection_adapters/postgresql/oid/date.rb +23 -0
- data/lib/active_record/connection_adapters/postgresql/oid/date_time.rb +2 -0
- data/lib/active_record/connection_adapters/postgresql/oid/decimal.rb +3 -1
- data/lib/active_record/connection_adapters/postgresql/oid/enum.rb +2 -0
- data/lib/active_record/connection_adapters/postgresql/oid/hstore.rb +2 -0
- data/lib/active_record/connection_adapters/postgresql/oid/inet.rb +2 -0
- data/lib/active_record/connection_adapters/postgresql/oid/jsonb.rb +3 -11
- data/lib/active_record/connection_adapters/postgresql/oid/legacy_point.rb +2 -0
- data/lib/active_record/connection_adapters/postgresql/oid/money.rb +3 -1
- data/lib/active_record/connection_adapters/postgresql/oid/oid.rb +2 -0
- data/lib/active_record/connection_adapters/postgresql/oid/point.rb +2 -0
- data/lib/active_record/connection_adapters/postgresql/oid/range.rb +8 -2
- data/lib/active_record/connection_adapters/postgresql/oid/specialized_string.rb +2 -0
- data/lib/active_record/connection_adapters/postgresql/oid/type_map_initializer.rb +4 -2
- data/lib/active_record/connection_adapters/postgresql/oid/uuid.rb +3 -1
- data/lib/active_record/connection_adapters/postgresql/oid/vector.rb +2 -0
- data/lib/active_record/connection_adapters/postgresql/oid/xml.rb +2 -0
- data/lib/active_record/connection_adapters/postgresql/quoting.rb +22 -1
- data/lib/active_record/connection_adapters/postgresql/referential_integrity.rb +19 -25
- data/lib/active_record/connection_adapters/postgresql/schema_creation.rb +50 -0
- data/lib/active_record/connection_adapters/postgresql/schema_definitions.rb +24 -11
- data/lib/active_record/connection_adapters/postgresql/schema_dumper.rb +20 -13
- data/lib/active_record/connection_adapters/postgresql/schema_statements.rb +258 -129
- data/lib/active_record/connection_adapters/postgresql/type_metadata.rb +2 -0
- data/lib/active_record/connection_adapters/postgresql/utils.rb +3 -1
- data/lib/active_record/connection_adapters/postgresql_adapter.rb +75 -87
- data/lib/active_record/connection_adapters/schema_cache.rb +4 -2
- data/lib/active_record/connection_adapters/sql_type_metadata.rb +2 -0
- data/lib/active_record/connection_adapters/sqlite3/explain_pretty_printer.rb +2 -0
- data/lib/active_record/connection_adapters/sqlite3/quoting.rb +24 -1
- data/lib/active_record/connection_adapters/sqlite3/schema_creation.rb +2 -0
- data/lib/active_record/connection_adapters/sqlite3/schema_definitions.rb +6 -15
- data/lib/active_record/connection_adapters/sqlite3/schema_dumper.rb +3 -2
- data/lib/active_record/connection_adapters/sqlite3/schema_statements.rb +75 -1
- data/lib/active_record/connection_adapters/sqlite3_adapter.rb +90 -96
- data/lib/active_record/connection_adapters/statement_pool.rb +2 -0
- data/lib/active_record/connection_handling.rb +4 -2
- data/lib/active_record/core.rb +41 -61
- data/lib/active_record/counter_cache.rb +20 -15
- data/lib/active_record/define_callbacks.rb +5 -3
- data/lib/active_record/dynamic_matchers.rb +9 -9
- data/lib/active_record/enum.rb +18 -13
- data/lib/active_record/errors.rb +60 -15
- data/lib/active_record/explain.rb +3 -1
- data/lib/active_record/explain_registry.rb +2 -0
- data/lib/active_record/explain_subscriber.rb +2 -0
- data/lib/active_record/fixture_set/file.rb +2 -0
- data/lib/active_record/fixtures.rb +67 -60
- data/lib/active_record/gem_version.rb +4 -2
- data/lib/active_record/inheritance.rb +49 -19
- data/lib/active_record/integration.rb +58 -19
- data/lib/active_record/internal_metadata.rb +2 -0
- data/lib/active_record/legacy_yaml_adapter.rb +3 -1
- data/lib/active_record/locking/optimistic.rb +30 -42
- data/lib/active_record/locking/pessimistic.rb +10 -7
- data/lib/active_record/log_subscriber.rb +46 -4
- data/lib/active_record/migration.rb +189 -139
- data/lib/active_record/migration/command_recorder.rb +11 -9
- data/lib/active_record/migration/compatibility.rb +81 -29
- data/lib/active_record/migration/join_table.rb +2 -0
- data/lib/active_record/model_schema.rb +74 -58
- data/lib/active_record/nested_attributes.rb +18 -6
- data/lib/active_record/no_touching.rb +3 -1
- data/lib/active_record/null_relation.rb +2 -0
- data/lib/active_record/persistence.rb +199 -54
- data/lib/active_record/query_cache.rb +8 -10
- data/lib/active_record/querying.rb +5 -3
- data/lib/active_record/railtie.rb +62 -6
- data/lib/active_record/railties/console_sandbox.rb +2 -0
- data/lib/active_record/railties/controller_runtime.rb +2 -0
- data/lib/active_record/railties/databases.rake +48 -38
- data/lib/active_record/readonly_attributes.rb +3 -2
- data/lib/active_record/reflection.rb +137 -207
- data/lib/active_record/relation.rb +132 -207
- data/lib/active_record/relation/batches.rb +32 -17
- data/lib/active_record/relation/batches/batch_enumerator.rb +2 -0
- data/lib/active_record/relation/calculations.rb +66 -25
- data/lib/active_record/relation/delegation.rb +45 -29
- data/lib/active_record/relation/finder_methods.rb +76 -85
- data/lib/active_record/relation/from_clause.rb +2 -8
- data/lib/active_record/relation/merger.rb +53 -23
- data/lib/active_record/relation/predicate_builder.rb +60 -79
- data/lib/active_record/relation/predicate_builder/array_handler.rb +10 -7
- data/lib/active_record/relation/predicate_builder/association_query_value.rb +46 -0
- data/lib/active_record/relation/predicate_builder/base_handler.rb +2 -2
- data/lib/active_record/relation/predicate_builder/basic_object_handler.rb +12 -1
- data/lib/active_record/relation/predicate_builder/polymorphic_array_value.rb +56 -0
- data/lib/active_record/relation/predicate_builder/range_handler.rb +26 -9
- data/lib/active_record/relation/predicate_builder/relation_handler.rb +6 -0
- data/lib/active_record/relation/query_attribute.rb +28 -2
- data/lib/active_record/relation/query_methods.rb +135 -103
- data/lib/active_record/relation/record_fetch_warning.rb +2 -0
- data/lib/active_record/relation/spawn_methods.rb +4 -2
- data/lib/active_record/relation/where_clause.rb +65 -67
- data/lib/active_record/relation/where_clause_factory.rb +5 -48
- data/lib/active_record/result.rb +2 -0
- data/lib/active_record/runtime_registry.rb +2 -0
- data/lib/active_record/sanitization.rb +129 -121
- data/lib/active_record/schema.rb +4 -2
- data/lib/active_record/schema_dumper.rb +36 -26
- data/lib/active_record/schema_migration.rb +2 -0
- data/lib/active_record/scoping.rb +12 -10
- data/lib/active_record/scoping/default.rb +10 -7
- data/lib/active_record/scoping/named.rb +40 -12
- data/lib/active_record/secure_token.rb +2 -0
- data/lib/active_record/serialization.rb +2 -0
- data/lib/active_record/statement_cache.rb +22 -12
- data/lib/active_record/store.rb +3 -1
- data/lib/active_record/suppressor.rb +2 -0
- data/lib/active_record/table_metadata.rb +12 -3
- data/lib/active_record/tasks/database_tasks.rb +38 -26
- data/lib/active_record/tasks/mysql_database_tasks.rb +11 -50
- data/lib/active_record/tasks/postgresql_database_tasks.rb +11 -3
- data/lib/active_record/tasks/sqlite_database_tasks.rb +25 -3
- data/lib/active_record/timestamp.rb +13 -6
- data/lib/active_record/touch_later.rb +2 -0
- data/lib/active_record/transactions.rb +32 -27
- data/lib/active_record/translation.rb +2 -0
- data/lib/active_record/type.rb +4 -1
- data/lib/active_record/type/adapter_specific_registry.rb +2 -0
- data/lib/active_record/type/date.rb +2 -0
- data/lib/active_record/type/date_time.rb +2 -0
- data/lib/active_record/type/decimal_without_scale.rb +2 -0
- data/lib/active_record/type/hash_lookup_type_map.rb +2 -0
- data/lib/active_record/type/internal/timezone.rb +2 -0
- data/lib/active_record/type/json.rb +30 -0
- data/lib/active_record/type/serialized.rb +6 -0
- data/lib/active_record/type/text.rb +2 -0
- data/lib/active_record/type/time.rb +2 -0
- data/lib/active_record/type/type_map.rb +2 -0
- data/lib/active_record/type/unsigned_integer.rb +2 -0
- data/lib/active_record/type_caster.rb +2 -0
- data/lib/active_record/type_caster/connection.rb +2 -0
- data/lib/active_record/type_caster/map.rb +3 -1
- data/lib/active_record/validations.rb +2 -0
- data/lib/active_record/validations/absence.rb +2 -0
- data/lib/active_record/validations/associated.rb +2 -0
- data/lib/active_record/validations/length.rb +2 -0
- data/lib/active_record/validations/presence.rb +2 -0
- data/lib/active_record/validations/uniqueness.rb +36 -6
- data/lib/active_record/version.rb +2 -0
- data/lib/rails/generators/active_record.rb +3 -1
- data/lib/rails/generators/active_record/application_record/application_record_generator.rb +27 -0
- data/lib/rails/generators/active_record/{model/templates/application_record.rb → application_record/templates/application_record.rb.tt} +0 -0
- data/lib/rails/generators/active_record/migration.rb +2 -0
- data/lib/rails/generators/active_record/migration/migration_generator.rb +3 -1
- data/lib/rails/generators/active_record/migration/templates/{create_table_migration.rb → create_table_migration.rb.tt} +0 -0
- data/lib/rails/generators/active_record/migration/templates/{migration.rb → migration.rb.tt} +0 -0
- data/lib/rails/generators/active_record/model/model_generator.rb +2 -23
- data/lib/rails/generators/active_record/model/templates/{model.rb → model.rb.tt} +0 -0
- data/lib/rails/generators/active_record/model/templates/{module.rb → module.rb.tt} +0 -0
- metadata +24 -36
- data/lib/active_record/associations/preloader/belongs_to.rb +0 -15
- data/lib/active_record/associations/preloader/collection_association.rb +0 -17
- data/lib/active_record/associations/preloader/has_many.rb +0 -15
- data/lib/active_record/associations/preloader/has_many_through.rb +0 -19
- data/lib/active_record/associations/preloader/has_one.rb +0 -15
- data/lib/active_record/associations/preloader/has_one_through.rb +0 -9
- data/lib/active_record/associations/preloader/singular_association.rb +0 -18
- data/lib/active_record/attribute.rb +0 -240
- data/lib/active_record/attribute/user_provided_default.rb +0 -30
- data/lib/active_record/attribute_mutation_tracker.rb +0 -113
- data/lib/active_record/attribute_set.rb +0 -113
- data/lib/active_record/attribute_set/builder.rb +0 -124
- data/lib/active_record/attribute_set/yaml_encoder.rb +0 -41
- data/lib/active_record/connection_adapters/postgresql/oid/json.rb +0 -10
- data/lib/active_record/railties/jdbcmysql_error.rb +0 -16
- data/lib/active_record/relation/predicate_builder/association_query_handler.rb +0 -88
- data/lib/active_record/relation/predicate_builder/polymorphic_array_handler.rb +0 -59
- data/lib/active_record/type/internal/abstract_json.rb +0 -33
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 3a6a58445af3e133df097836131d528804585b935b40025174db5e3a284351b5
|
4
|
+
data.tar.gz: 4d1b7fbc93cb5582065167d8d8a197ed887133b06170c5acf0ab6a18dea29465
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c91429dea93398c1c532da4f5a66435b73842887a4d0f86782dfb19ba3801dfa65e04410a26f503e18cbc434793f293c051c7844a3702a638f14443711d7d6ea
|
7
|
+
data.tar.gz: a224f223a6f2da2ac314fa2d6f0deb4befbb0a962cad19d8a5c93a769ffd45450d23df71d791dfadae0b56435207beee54e5126e2e9cee50e9678fbe233fff9b
|
data/CHANGELOG.md
CHANGED
@@ -1,791 +1,937 @@
|
|
1
|
-
## Rails 5.
|
1
|
+
## Rails 5.2.3 (March 27, 2019) ##
|
2
2
|
|
3
|
-
*
|
3
|
+
* Fix different `count` calculation when using `size` with manual `select` with DISTINCT.
|
4
4
|
|
5
|
-
|
5
|
+
Fixes #35214.
|
6
6
|
|
7
|
-
*
|
8
|
-
transactional fixtures, a nested transaction will temporarily lock the
|
9
|
-
connection to the current thread, forcing others to wait.
|
7
|
+
*Juani Villarejo*
|
10
8
|
|
11
|
-
|
9
|
+
* Fix prepared statements caching to be enabled even when query caching is enabled.
|
12
10
|
|
13
|
-
*
|
11
|
+
*Ryuta Kamizono*
|
14
12
|
|
15
|
-
*
|
13
|
+
* Don't allow `where` with invalid value matches to nil values.
|
16
14
|
|
17
|
-
|
18
|
-
load the records as needed.
|
15
|
+
Fixes #33624.
|
19
16
|
|
20
|
-
|
17
|
+
*Ryuta Kamizono*
|
21
18
|
|
22
|
-
|
19
|
+
* Restore an ability that class level `update` without giving ids.
|
23
20
|
|
24
|
-
|
25
|
-
version-specific parts of the file.
|
21
|
+
Fixes #34743.
|
26
22
|
|
27
|
-
|
23
|
+
*Ryuta Kamizono*
|
28
24
|
|
29
|
-
|
25
|
+
* Fix join table column quoting with SQLite.
|
30
26
|
|
31
|
-
*
|
27
|
+
*Gannon McGibbon*
|
32
28
|
|
33
|
-
|
34
|
-
record before validation. For example:
|
29
|
+
* Ensure that `delete_all` on collection proxy returns affected count.
|
35
30
|
|
36
|
-
|
37
|
-
belongs_to :account
|
38
|
-
before_validation -> { self.account ||= Current.account }
|
31
|
+
*Ryuta Kamizono*
|
39
32
|
|
40
|
-
|
41
|
-
belongs_to :account, default: -> { Current.account }
|
33
|
+
* Reset scope after delete on collection association to clear stale offsets of removed records.
|
42
34
|
|
43
|
-
*
|
35
|
+
*Gannon McGibbon*
|
44
36
|
|
45
|
-
* Deprecate `Migrator.schema_migrations_table_name`.
|
46
37
|
|
47
|
-
|
38
|
+
## Rails 5.2.2.1 (March 11, 2019) ##
|
48
39
|
|
49
|
-
*
|
40
|
+
* No changes.
|
50
41
|
|
51
|
-
Fixes #28348.
|
52
42
|
|
53
|
-
|
43
|
+
## Rails 5.2.2 (December 04, 2018) ##
|
54
44
|
|
55
|
-
*
|
45
|
+
* Do not ignore the scoping with query methods in the scope block.
|
56
46
|
|
57
|
-
|
58
|
-
path defined in `Rails.application.config.paths` however the code checked
|
59
|
-
for the presence of the `Rails` constant but not the `Rails.application`
|
60
|
-
method which caused problems when using Active Record and generators outside
|
61
|
-
of the context of a Rails application.
|
47
|
+
*Ryuta Kamizono*
|
62
48
|
|
63
|
-
|
49
|
+
* Allow aliased attributes to be used in `#update_columns` and `#update`.
|
64
50
|
|
65
|
-
*
|
51
|
+
*Gannon McGibbon*
|
66
52
|
|
67
|
-
*
|
53
|
+
* Allow spaces in postgres table names.
|
68
54
|
|
69
|
-
Fixes
|
55
|
+
Fixes issue where "user post" is misinterpreted as "\"user\".\"post\"" when quoting table names with the postgres
|
56
|
+
adapter.
|
70
57
|
|
71
|
-
*
|
58
|
+
*Gannon McGibbon*
|
72
59
|
|
73
|
-
*
|
60
|
+
* Cached columns_hash fields should be excluded from ResultSet#column_types
|
74
61
|
|
75
|
-
|
62
|
+
PR #34528 addresses the inconsistent behaviour when attribute is defined for an ignored column. The following test
|
63
|
+
was passing for SQLite and MySQL, but failed for PostgreSQL:
|
76
64
|
|
77
|
-
|
65
|
+
```ruby
|
66
|
+
class DeveloperName < ActiveRecord::Type::String
|
67
|
+
def deserialize(value)
|
68
|
+
"Developer: #{value}"
|
69
|
+
end
|
70
|
+
end
|
78
71
|
|
79
|
-
|
72
|
+
class AttributedDeveloper < ActiveRecord::Base
|
73
|
+
self.table_name = "developers"
|
80
74
|
|
81
|
-
|
75
|
+
attribute :name, DeveloperName.new
|
82
76
|
|
83
|
-
|
84
|
-
|
85
|
-
The `reference_id` column is usually an integer and the `reference_type`
|
86
|
-
column a string so options like `unsigned: true` will result in an invalid
|
87
|
-
table definition.
|
77
|
+
self.ignored_columns += ["name"]
|
78
|
+
end
|
88
79
|
|
89
|
-
|
80
|
+
developer = AttributedDeveloper.create
|
81
|
+
developer.update_column :name, "name"
|
90
82
|
|
91
|
-
|
83
|
+
loaded_developer = AttributedDeveloper.where(id: developer.id).select("*").first
|
84
|
+
puts loaded_developer.name # should be "Developer: name" but it's just "name"
|
85
|
+
```
|
92
86
|
|
93
|
-
*
|
87
|
+
*Dmitry Tsepelev*
|
94
88
|
|
95
|
-
*
|
89
|
+
* Values of enum are frozen, raising an error when attempting to modify them.
|
96
90
|
|
97
|
-
*
|
91
|
+
*Emmanuel Byrd*
|
98
92
|
|
99
|
-
*
|
93
|
+
* `update_columns` now correctly raises `ActiveModel::MissingAttributeError`
|
94
|
+
if the attribute does not exist.
|
100
95
|
|
101
|
-
*
|
96
|
+
*Sean Griffin*
|
102
97
|
|
103
|
-
*
|
98
|
+
* Do not use prepared statement in queries that have a large number of binds.
|
104
99
|
|
105
100
|
*Ryuta Kamizono*
|
106
101
|
|
107
|
-
* Fix
|
102
|
+
* Fix query cache to load before first request.
|
108
103
|
|
109
|
-
|
104
|
+
*Eileen M. Uchitelle*
|
110
105
|
|
111
|
-
|
106
|
+
* Fix collection cache key with limit and custom select to avoid ambiguous timestamp column error.
|
112
107
|
|
113
|
-
|
108
|
+
Fixes #33056.
|
114
109
|
|
115
|
-
|
116
|
-
Internal representation of the timestamp type is UNIX time, This means
|
117
|
-
that timestamp columns are affected by time zone.
|
110
|
+
*Federico Martinez*
|
118
111
|
|
119
|
-
|
120
|
-
Query OK, 0 rows affected (0.00 sec)
|
112
|
+
* Fix duplicated record creation when using nested attributes with `create_with`.
|
121
113
|
|
122
|
-
|
123
|
-
Query OK, 1 row affected (0.02 sec)
|
114
|
+
*Darwin Wu*
|
124
115
|
|
125
|
-
|
126
|
-
+---------------------+---------------------+
|
127
|
-
| ts | dt |
|
128
|
-
+---------------------+---------------------+
|
129
|
-
| 2016-02-07 22:11:44 | 2016-02-07 22:11:44 |
|
130
|
-
+---------------------+---------------------+
|
131
|
-
1 row in set (0.00 sec)
|
116
|
+
* Fix regression setting children record in parent `before_save` callback.
|
132
117
|
|
133
|
-
|
134
|
-
Query OK, 0 rows affected (0.00 sec)
|
118
|
+
*Guo Xiang Tan*
|
135
119
|
|
136
|
-
|
137
|
-
+---------------------+---------------------+
|
138
|
-
| ts | dt |
|
139
|
-
+---------------------+---------------------+
|
140
|
-
| 2016-02-07 14:11:44 | 2016-02-07 22:11:44 |
|
141
|
-
+---------------------+---------------------+
|
142
|
-
1 row in set (0.00 sec)
|
120
|
+
* Prevent leaking of user's DB credentials on `rails db:create` failure.
|
143
121
|
|
144
|
-
*
|
122
|
+
*bogdanvlviv*
|
145
123
|
|
146
|
-
*
|
124
|
+
* Clear mutation tracker before continuing the around callbacks.
|
147
125
|
|
148
|
-
*
|
126
|
+
*Yuya Tanaka*
|
149
127
|
|
150
|
-
*
|
128
|
+
* Prevent deadlocks when waiting for connection from pool.
|
151
129
|
|
152
|
-
*
|
130
|
+
*Brent Wheeldon*
|
153
131
|
|
154
|
-
*
|
132
|
+
* Avoid extra scoping when using `Relation#update` that was causing this method to change the current scope.
|
155
133
|
|
156
134
|
*Ryuta Kamizono*
|
157
135
|
|
158
|
-
*
|
136
|
+
* Fix numericality validator not to be affected by custom getter.
|
159
137
|
|
160
138
|
*Ryuta Kamizono*
|
161
139
|
|
162
|
-
*
|
163
|
-
been long unused and unsupported.
|
140
|
+
* Fix bulk change table ignores comment option on PostgreSQL.
|
164
141
|
|
165
|
-
*
|
142
|
+
*Yoshiyuki Kinjo*
|
166
143
|
|
167
|
-
* Make `table_name=` reset current statement cache,
|
168
|
-
so queries are not run against the previous table name.
|
169
144
|
|
170
|
-
|
145
|
+
## Rails 5.2.1.1 (November 27, 2018) ##
|
171
146
|
|
172
|
-
*
|
147
|
+
* No changes.
|
173
148
|
|
174
|
-
*Isaac Betesh*
|
175
149
|
|
176
|
-
|
150
|
+
## Rails 5.2.1 (August 07, 2018) ##
|
177
151
|
|
178
|
-
|
152
|
+
* PostgreSQL: Support new relkind for partitioned tables.
|
179
153
|
|
180
|
-
|
154
|
+
Fixes #33008.
|
181
155
|
|
182
|
-
*
|
156
|
+
*Yannick Schutz*
|
183
157
|
|
184
|
-
*
|
158
|
+
* Rollback parent transaction when children fails to update.
|
185
159
|
|
186
|
-
*
|
160
|
+
*Guillaume Malette*
|
161
|
+
|
162
|
+
* Fix default value for MySQL time types with specified precision.
|
187
163
|
|
188
|
-
*
|
164
|
+
*Nikolay Kondratyev*
|
165
|
+
|
166
|
+
* Fix `touch` option to behave consistently with `Persistence#touch` method.
|
189
167
|
|
190
168
|
*Ryuta Kamizono*
|
191
169
|
|
192
|
-
* Fix `
|
170
|
+
* Fix `save` in `after_create_commit` won't invoke extra `after_create_commit`.
|
193
171
|
|
194
|
-
Fixes #
|
172
|
+
Fixes #32831.
|
195
173
|
|
196
|
-
*
|
174
|
+
*Ryuta Kamizono*
|
197
175
|
|
198
|
-
*
|
176
|
+
* Fix logic on disabling commit callbacks so they are not called unexpectedly when errors occur.
|
199
177
|
|
200
|
-
|
201
|
-
MariaDB virtual columns: https://mariadb.com/kb/en/mariadb/virtual-computed-columns/
|
178
|
+
*Brian Durand*
|
202
179
|
|
203
|
-
|
204
|
-
Pass `stored: true` to persist the generated value (false by default).
|
180
|
+
* Fix parent record should not get saved with duplicate children records.
|
205
181
|
|
206
|
-
|
182
|
+
Fixes #32940.
|
207
183
|
|
208
|
-
|
209
|
-
t.string :name
|
210
|
-
t.virtual :upper_name, type: :string, as: "UPPER(name)"
|
211
|
-
t.virtual :name_length, type: :integer, as: "LENGTH(name)", stored: true
|
212
|
-
t.index :name_length # May be indexed, too!
|
213
|
-
end
|
184
|
+
*Santosh Wadghule*
|
214
185
|
|
215
|
-
|
186
|
+
* Fix that association's after_touch is not called with counter cache.
|
216
187
|
|
217
|
-
|
188
|
+
Fixes #31559.
|
218
189
|
|
219
190
|
*Ryuta Kamizono*
|
220
191
|
|
221
|
-
*
|
192
|
+
* `becomes` should clear the mutation tracker which is created in `after_initialize`.
|
193
|
+
|
194
|
+
Fixes #32867.
|
222
195
|
|
223
196
|
*Ryuta Kamizono*
|
224
197
|
|
225
|
-
*
|
198
|
+
* Allow a belonging to parent object to be created from a new record.
|
226
199
|
|
227
|
-
*
|
200
|
+
*Jolyon Pawlyn*
|
228
201
|
|
229
|
-
*
|
202
|
+
* Fix that building record with assigning multiple has_one associations
|
203
|
+
wrongly persists through record.
|
230
204
|
|
231
|
-
|
205
|
+
Fixes #32511.
|
232
206
|
|
233
|
-
*
|
207
|
+
*Sam DeCesare*
|
234
208
|
|
235
|
-
|
209
|
+
* Fix relation merging when one of the relations is going to skip the
|
210
|
+
query cache.
|
236
211
|
|
237
|
-
*
|
238
|
-
necessary and potentially creates circular dependencies.
|
212
|
+
*James Williams*
|
239
213
|
|
240
|
-
*Kir Shatrov*
|
241
214
|
|
242
|
-
|
215
|
+
## Rails 5.2.0 (April 09, 2018) ##
|
243
216
|
|
244
|
-
|
217
|
+
* MySQL: Support mysql2 0.5.x.
|
245
218
|
|
246
|
-
*
|
219
|
+
*Aaron Stone*
|
247
220
|
|
248
|
-
*
|
221
|
+
* Apply time column precision on assignment.
|
249
222
|
|
250
|
-
|
223
|
+
PR #20317 changed the behavior of datetime columns so that when they
|
224
|
+
have a specified precision then on assignment the value is rounded to
|
225
|
+
that precision. This behavior is now applied to time columns as well.
|
251
226
|
|
252
|
-
|
227
|
+
Fixes #30301.
|
253
228
|
|
254
|
-
*
|
229
|
+
*Andrew White*
|
255
230
|
|
256
|
-
*
|
257
|
-
calling `ActiveRecord::Dirty#changed_in_place?`.
|
231
|
+
* Normalize time column values for SQLite database.
|
258
232
|
|
259
|
-
|
233
|
+
For legacy reasons, time columns in SQLite are stored as full datetimes
|
234
|
+
because until #24542 the quoting for time columns didn't remove the date
|
235
|
+
component. To ensure that values are consistent we now normalize the
|
236
|
+
date component to 2001-01-01 on reading and writing.
|
260
237
|
|
261
|
-
*
|
238
|
+
*Andrew White*
|
262
239
|
|
263
|
-
*
|
264
|
-
`.exists?` and `.update`.
|
240
|
+
* Ensure that the date component is removed when quoting times.
|
265
241
|
|
266
|
-
|
242
|
+
PR #24542 altered the quoting for time columns so that the date component
|
243
|
+
was removed however it only removed it when it was 2001-01-01. Now the
|
244
|
+
date component is removed irrespective of what the date is.
|
267
245
|
|
268
|
-
*
|
246
|
+
*Andrew White*
|
269
247
|
|
270
|
-
|
248
|
+
* Fix `dependent: :destroy` issue for has_one/belongs_to relationship where
|
249
|
+
the parent class was getting deleted when the child was not.
|
271
250
|
|
272
|
-
|
251
|
+
Fixes #32022.
|
273
252
|
|
274
|
-
*
|
253
|
+
*Fernando Gorodscy*
|
275
254
|
|
276
|
-
|
255
|
+
* Whitelist `NULLS FIRST` and `NULLS LAST` in order clauses too.
|
277
256
|
|
278
|
-
*
|
257
|
+
*Xavier Noria*
|
279
258
|
|
280
|
-
|
259
|
+
* Fix that after commit callbacks on update does not triggered when optimistic locking is enabled.
|
281
260
|
|
282
|
-
|
283
|
-
Topic.increment_counter(:messages_count, 1, touch: true)
|
284
|
-
Topic.decrement_counter(:messages_count, 1, touch: true)
|
261
|
+
*Ryuta Kamizono*
|
285
262
|
|
286
|
-
|
287
|
-
|
263
|
+
* Fix `#columns_for_distinct` of MySQL and PostgreSQL to make
|
264
|
+
`ActiveRecord::FinderMethods#limited_ids_for` use correct primary key values
|
265
|
+
even if `ORDER BY` columns include other table's primary key.
|
288
266
|
|
289
|
-
|
290
|
-
Topic.update_counters(18, messages_count: 5, touch: %i( updated_at last_discussed_at ))
|
267
|
+
Fixes #28364.
|
291
268
|
|
292
|
-
|
269
|
+
*Takumi Kagiyama*
|
293
270
|
|
294
|
-
|
271
|
+
* Make `reflection.klass` raise if `polymorphic?` not to be misused.
|
295
272
|
|
296
|
-
|
273
|
+
Fixes #31876.
|
297
274
|
|
298
275
|
*Ryuta Kamizono*
|
299
276
|
|
300
|
-
*
|
277
|
+
* PostgreSQL: Allow pg-1.0 gem to be used with Active Record.
|
301
278
|
|
302
|
-
*
|
279
|
+
*Lars Kanis*
|
303
280
|
|
304
|
-
*
|
281
|
+
* Deprecate `expand_hash_conditions_for_aggregates` without replacement.
|
282
|
+
Using a `Relation` for performing queries is the prefered API.
|
305
283
|
|
306
|
-
*
|
284
|
+
*Ryuta Kamizono*
|
307
285
|
|
308
|
-
*
|
286
|
+
* Fix not expanded problem when passing an Array object as argument to the where method using `composed_of` column.
|
309
287
|
|
310
|
-
|
288
|
+
```
|
289
|
+
david_balance = customers(:david).balance
|
290
|
+
Customer.where(balance: [david_balance]).to_sql
|
311
291
|
|
312
|
-
|
292
|
+
# Before: WHERE `customers`.`balance` = NULL
|
293
|
+
# After : WHERE `customers`.`balance` = 50
|
294
|
+
```
|
313
295
|
|
314
|
-
|
296
|
+
Fixes #31723.
|
315
297
|
|
316
|
-
*
|
298
|
+
*Yutaro Kanagawa*
|
317
299
|
|
318
|
-
|
300
|
+
* Fix `count(:all)` with eager loading and having an order other than the driving table.
|
319
301
|
|
320
|
-
|
302
|
+
Fixes #31783.
|
321
303
|
|
322
|
-
*
|
304
|
+
*Ryuta Kamizono*
|
323
305
|
|
324
|
-
*
|
306
|
+
* Clear the transaction state when an Active Record object is duped.
|
325
307
|
|
326
|
-
|
308
|
+
Fixes #31670.
|
327
309
|
|
328
|
-
*
|
310
|
+
*Yuriy Ustushenko*
|
329
311
|
|
330
|
-
|
312
|
+
* Support for PostgreSQL foreign tables.
|
331
313
|
|
332
|
-
*
|
333
|
-
order.
|
314
|
+
*fatkodima*
|
334
315
|
|
335
|
-
|
316
|
+
* Fix relation merger issue with `left_outer_joins`.
|
336
317
|
|
337
|
-
*
|
318
|
+
*Mehmet Emin İNAÇ*
|
338
319
|
|
339
|
-
|
320
|
+
* Don't allow destroyed object mutation after `save` or `save!` is called.
|
340
321
|
|
341
|
-
*
|
322
|
+
*Ryuta Kamizono*
|
342
323
|
|
343
|
-
|
324
|
+
* Take into account association conditions when deleting through records.
|
344
325
|
|
345
|
-
|
346
|
-
and `ActiveRecord::StatementInvalid#original_exception`.
|
326
|
+
Fixes #18424.
|
347
327
|
|
348
|
-
*
|
328
|
+
*Piotr Jakubowski*
|
349
329
|
|
350
|
-
*
|
330
|
+
* Fix nested `has_many :through` associations on unpersisted parent instances.
|
351
331
|
|
352
|
-
|
332
|
+
For example, if you have
|
353
333
|
|
354
|
-
|
334
|
+
class Post < ActiveRecord::Base
|
335
|
+
belongs_to :author
|
336
|
+
has_many :books, through: :author
|
337
|
+
has_many :subscriptions, through: :books
|
338
|
+
end
|
355
339
|
|
356
|
-
|
340
|
+
class Author < ActiveRecord::Base
|
341
|
+
has_one :post
|
342
|
+
has_many :books
|
343
|
+
has_many :subscriptions, through: :books
|
344
|
+
end
|
357
345
|
|
358
|
-
|
346
|
+
class Book < ActiveRecord::Base
|
347
|
+
belongs_to :author
|
348
|
+
has_many :subscriptions
|
349
|
+
end
|
359
350
|
|
360
|
-
|
351
|
+
class Subscription < ActiveRecord::Base
|
352
|
+
belongs_to :book
|
353
|
+
end
|
361
354
|
|
362
|
-
|
355
|
+
Before:
|
363
356
|
|
364
|
-
|
365
|
-
`config.active_record.time_zone_aware_types` is not explicitly set.
|
357
|
+
If `post` is not persisted, then `post.subscriptions` will be empty.
|
366
358
|
|
367
|
-
|
359
|
+
After:
|
368
360
|
|
369
|
-
|
361
|
+
If `post` is not persisted, then `post.subscriptions` can be set and used
|
362
|
+
just like it would if `post` were persisted.
|
370
363
|
|
371
|
-
|
364
|
+
Fixes #16313.
|
372
365
|
|
373
|
-
*
|
374
|
-
`activerecord.errors.messages.restrict_dependent_destroy.many` i18n scopes.
|
366
|
+
*Zoltan Kiss*
|
375
367
|
|
376
|
-
|
368
|
+
* Fixed inconsistency with `first(n)` when used with `limit()`.
|
369
|
+
The `first(n)` finder now respects the `limit()`, making it consistent
|
370
|
+
with `relation.to_a.first(n)`, and also with the behavior of `last(n)`.
|
377
371
|
|
378
|
-
|
372
|
+
Fixes #23979.
|
379
373
|
|
380
|
-
|
381
|
-
eventual commands run against the database, e.g. mysqldump/pg_dump.
|
374
|
+
*Brian Christian*
|
382
375
|
|
383
|
-
|
376
|
+
* Use `count(:all)` in `HasManyAssociation#count_records` to prevent invalid
|
377
|
+
SQL queries for association counting.
|
384
378
|
|
385
|
-
*
|
379
|
+
*Klas Eskilson*
|
386
380
|
|
387
|
-
|
381
|
+
* Fix to invoke callbacks when using `update_attribute`.
|
388
382
|
|
389
|
-
*
|
383
|
+
*Mike Busch*
|
390
384
|
|
391
|
-
*
|
385
|
+
* Fix `count(:all)` to correctly work `distinct` with custom SELECT list.
|
392
386
|
|
393
|
-
*
|
387
|
+
*Ryuta Kamizono*
|
394
388
|
|
395
|
-
*
|
389
|
+
* Using subselect for `delete_all` with `limit` or `offset`.
|
396
390
|
|
397
|
-
*
|
391
|
+
*Ryuta Kamizono*
|
398
392
|
|
399
|
-
*
|
400
|
-
|
393
|
+
* Undefine attribute methods on descendants when resetting column
|
394
|
+
information.
|
395
|
+
|
396
|
+
*Chris Salzberg*
|
397
|
+
|
398
|
+
* Log database query callers.
|
399
|
+
|
400
|
+
Add `verbose_query_logs` configuration option to display the caller
|
401
|
+
of database queries in the log to facilitate N+1 query resolution
|
402
|
+
and other debugging.
|
403
|
+
|
404
|
+
Enabled in development only for new and upgraded applications. Not
|
405
|
+
recommended for use in the production environment since it relies
|
406
|
+
on Ruby's `Kernel#caller_locations` which is fairly slow.
|
407
|
+
|
408
|
+
*Olivier Lacan*
|
409
|
+
|
410
|
+
* Fix conflicts `counter_cache` with `touch: true` by optimistic locking.
|
411
|
+
|
412
|
+
```
|
413
|
+
# create_table :posts do |t|
|
414
|
+
# t.integer :comments_count, default: 0
|
415
|
+
# t.integer :lock_version
|
416
|
+
# t.timestamps
|
417
|
+
# end
|
418
|
+
class Post < ApplicationRecord
|
419
|
+
end
|
420
|
+
|
421
|
+
# create_table :comments do |t|
|
422
|
+
# t.belongs_to :post
|
423
|
+
# end
|
424
|
+
class Comment < ApplicationRecord
|
425
|
+
belongs_to :post, touch: true, counter_cache: true
|
426
|
+
end
|
427
|
+
```
|
428
|
+
|
429
|
+
Before:
|
430
|
+
```
|
431
|
+
post = Post.create!
|
432
|
+
# => begin transaction
|
433
|
+
INSERT INTO "posts" ("created_at", "updated_at", "lock_version")
|
434
|
+
VALUES ("2017-12-11 21:27:11.387397", "2017-12-11 21:27:11.387397", 0)
|
435
|
+
commit transaction
|
436
|
+
|
437
|
+
comment = Comment.create!(post: post)
|
438
|
+
# => begin transaction
|
439
|
+
INSERT INTO "comments" ("post_id") VALUES (1)
|
440
|
+
|
441
|
+
UPDATE "posts" SET "comments_count" = COALESCE("comments_count", 0) + 1,
|
442
|
+
"lock_version" = COALESCE("lock_version", 0) + 1 WHERE "posts"."id" = 1
|
443
|
+
|
444
|
+
UPDATE "posts" SET "updated_at" = '2017-12-11 21:27:11.398330',
|
445
|
+
"lock_version" = 1 WHERE "posts"."id" = 1 AND "posts"."lock_version" = 0
|
446
|
+
rollback transaction
|
447
|
+
# => ActiveRecord::StaleObjectError: Attempted to touch a stale object: Post.
|
448
|
+
|
449
|
+
Comment.take.destroy!
|
450
|
+
# => begin transaction
|
451
|
+
DELETE FROM "comments" WHERE "comments"."id" = 1
|
452
|
+
|
453
|
+
UPDATE "posts" SET "comments_count" = COALESCE("comments_count", 0) - 1,
|
454
|
+
"lock_version" = COALESCE("lock_version", 0) + 1 WHERE "posts"."id" = 1
|
455
|
+
|
456
|
+
UPDATE "posts" SET "updated_at" = '2017-12-11 21:42:47.785901',
|
457
|
+
"lock_version" = 1 WHERE "posts"."id" = 1 AND "posts"."lock_version" = 0
|
458
|
+
rollback transaction
|
459
|
+
# => ActiveRecord::StaleObjectError: Attempted to touch a stale object: Post.
|
460
|
+
```
|
461
|
+
|
462
|
+
After:
|
463
|
+
```
|
464
|
+
post = Post.create!
|
465
|
+
# => begin transaction
|
466
|
+
INSERT INTO "posts" ("created_at", "updated_at", "lock_version")
|
467
|
+
VALUES ("2017-12-11 21:27:11.387397", "2017-12-11 21:27:11.387397", 0)
|
468
|
+
commit transaction
|
469
|
+
|
470
|
+
comment = Comment.create!(post: post)
|
471
|
+
# => begin transaction
|
472
|
+
INSERT INTO "comments" ("post_id") VALUES (1)
|
473
|
+
|
474
|
+
UPDATE "posts" SET "comments_count" = COALESCE("comments_count", 0) + 1,
|
475
|
+
"lock_version" = COALESCE("lock_version", 0) + 1,
|
476
|
+
"updated_at" = '2017-12-11 21:37:09.802642' WHERE "posts"."id" = 1
|
477
|
+
commit transaction
|
478
|
+
|
479
|
+
comment.destroy!
|
480
|
+
# => begin transaction
|
481
|
+
DELETE FROM "comments" WHERE "comments"."id" = 1
|
482
|
+
|
483
|
+
UPDATE "posts" SET "comments_count" = COALESCE("comments_count", 0) - 1,
|
484
|
+
"lock_version" = COALESCE("lock_version", 0) + 1,
|
485
|
+
"updated_at" = '2017-12-11 21:39:02.685520' WHERE "posts"."id" = 1
|
486
|
+
commit transaction
|
487
|
+
```
|
488
|
+
|
489
|
+
Fixes #31199.
|
401
490
|
|
402
|
-
|
491
|
+
*bogdanvlviv*
|
403
492
|
|
404
|
-
|
493
|
+
* Add support for PostgreSQL operator classes to `add_index`.
|
405
494
|
|
406
|
-
|
495
|
+
Example:
|
407
496
|
|
408
|
-
|
497
|
+
add_index :users, :name, using: :gist, opclass: { name: :gist_trgm_ops }
|
409
498
|
|
410
|
-
*
|
411
|
-
or updated because it would violate a not null constraint.
|
499
|
+
*Greg Navis*
|
412
500
|
|
413
|
-
|
501
|
+
* Don't allow scopes to be defined which conflict with instance methods on `Relation`.
|
414
502
|
|
415
|
-
|
503
|
+
Fixes #31120.
|
416
504
|
|
417
|
-
|
418
|
-
twice or destroyed and updated. The callbacks should only be
|
419
|
-
triggered once, similar to a SQL database trigger.
|
505
|
+
*kinnrot*
|
420
506
|
|
421
|
-
|
507
|
+
* Add new error class `QueryCanceled` which will be raised
|
508
|
+
when canceling statement due to user request.
|
422
509
|
|
423
|
-
*
|
510
|
+
*Ryuta Kamizono*
|
424
511
|
|
425
|
-
|
512
|
+
* Add `#up_only` to database migrations for code that is only relevant when
|
513
|
+
migrating up, e.g. populating a new column.
|
426
514
|
|
427
|
-
*
|
428
|
-
use the aliased attribute name if needed.
|
515
|
+
*Rich Daley*
|
429
516
|
|
430
|
-
|
517
|
+
* Require raw SQL fragments to be explicitly marked when used in
|
518
|
+
relation query methods.
|
431
519
|
|
432
|
-
|
433
|
-
|
520
|
+
Before:
|
521
|
+
```
|
522
|
+
Article.order("LENGTH(title)")
|
523
|
+
```
|
434
524
|
|
435
|
-
|
525
|
+
After:
|
526
|
+
```
|
527
|
+
Article.order(Arel.sql("LENGTH(title)"))
|
528
|
+
```
|
436
529
|
|
437
|
-
|
530
|
+
This prevents SQL injection if applications use the [strongly
|
531
|
+
discouraged] form `Article.order(params[:my_order])`, under the
|
532
|
+
mistaken belief that only column names will be accepted.
|
438
533
|
|
439
|
-
|
534
|
+
Raw SQL strings will now cause a deprecation warning, which will
|
535
|
+
become an UnknownAttributeReference error in Rails 6.0. Applications
|
536
|
+
can opt in to the future behavior by setting `allow_unsafe_raw_sql`
|
537
|
+
to `:disabled`.
|
440
538
|
|
441
|
-
|
539
|
+
Common and judged-safe string values (such as simple column
|
540
|
+
references) are unaffected:
|
541
|
+
```
|
542
|
+
Article.order("title DESC")
|
543
|
+
```
|
442
544
|
|
443
|
-
*
|
444
|
-
The default is now `ActiveRecord::Type::Value.new`, which provides no type
|
445
|
-
casting behavior.
|
545
|
+
*Ben Toews*
|
446
546
|
|
447
|
-
|
547
|
+
* `update_all` will now pass its values to `Type#cast` before passing them to
|
548
|
+
`Type#serialize`. This means that `update_all(foo: 'true')` will properly
|
549
|
+
persist a boolean.
|
448
550
|
|
449
|
-
*
|
551
|
+
*Sean Griffin*
|
450
552
|
|
451
|
-
|
553
|
+
* Add new error class `StatementTimeout` which will be raised
|
554
|
+
when statement timeout exceeded.
|
452
555
|
|
453
556
|
*Ryuta Kamizono*
|
454
557
|
|
455
|
-
* Fix
|
558
|
+
* Fix `bin/rails db:migrate` with specified `VERSION`.
|
559
|
+
`bin/rails db:migrate` with empty VERSION behaves as without `VERSION`.
|
560
|
+
Check a format of `VERSION`: Allow a migration version number
|
561
|
+
or name of a migration file. Raise error if format of `VERSION` is invalid.
|
562
|
+
Raise error if target migration doesn't exist.
|
456
563
|
|
457
|
-
*
|
564
|
+
*bogdanvlviv*
|
458
565
|
|
459
|
-
*
|
460
|
-
|
566
|
+
* Fixed a bug where column orders for an index weren't written to
|
567
|
+
`db/schema.rb` when using the sqlite adapter.
|
461
568
|
|
462
|
-
|
463
|
-
type of the primary key set in the association, not the model
|
464
|
-
primary key.
|
569
|
+
Fixes #30902.
|
465
570
|
|
466
|
-
*
|
571
|
+
*Paul Kuruvilla*
|
467
572
|
|
468
|
-
*
|
469
|
-
`uuid-ossp`'s UUID generation function.
|
573
|
+
* Remove deprecated method `#sanitize_conditions`.
|
470
574
|
|
471
|
-
*
|
575
|
+
*Rafael Mendonça França*
|
472
576
|
|
473
|
-
*
|
474
|
-
of `Article.category(true)` where `category` is a singular
|
475
|
-
association.
|
577
|
+
* Remove deprecated method `#scope_chain`.
|
476
578
|
|
477
|
-
|
478
|
-
in #20888. Unfortunately the suggested alternative of
|
479
|
-
`article.reload.category` does not expose the same behavior.
|
579
|
+
*Rafael Mendonça França*
|
480
580
|
|
481
|
-
|
482
|
-
singular associations. This method has the same semantics as
|
483
|
-
passing true to the association reader used to have.
|
581
|
+
* Remove deprecated configuration `.error_on_ignored_order_or_limit`.
|
484
582
|
|
485
|
-
*
|
583
|
+
*Rafael Mendonça França*
|
486
584
|
|
487
|
-
*
|
488
|
-
constants defined in `ActiveRecord::Associations::Preloader`.
|
585
|
+
* Remove deprecated arguments from `#verify!`.
|
489
586
|
|
490
|
-
*
|
587
|
+
*Rafael Mendonça França*
|
491
588
|
|
492
|
-
*
|
493
|
-
values for Postgres HStore columns.
|
589
|
+
* Remove deprecated argument `name` from `#indexes`.
|
494
590
|
|
495
|
-
|
591
|
+
*Rafael Mendonça França*
|
496
592
|
|
497
|
-
|
593
|
+
* Remove deprecated method `ActiveRecord::Migrator.schema_migrations_table_name`.
|
498
594
|
|
499
|
-
*
|
595
|
+
*Rafael Mendonça França*
|
500
596
|
|
501
|
-
|
597
|
+
* Remove deprecated method `supports_primary_key?`.
|
502
598
|
|
503
|
-
|
504
|
-
{ size: 15, connections: 1, busy: 1, dead: 0, idle: 0, waiting: 0, checkout_timeout: 5 }
|
599
|
+
*Rafael Mendonça França*
|
505
600
|
|
506
|
-
|
601
|
+
* Remove deprecated method `supports_migrations?`.
|
507
602
|
|
508
|
-
*
|
509
|
-
and `exists?`.
|
603
|
+
*Rafael Mendonça França*
|
510
604
|
|
511
|
-
|
512
|
-
for performance. We should not unscope the order in the case.
|
605
|
+
* Remove deprecated methods `initialize_schema_migrations_table` and `initialize_internal_metadata_table`.
|
513
606
|
|
514
|
-
*
|
607
|
+
*Rafael Mendonça França*
|
515
608
|
|
516
|
-
*
|
517
|
-
datetime.
|
609
|
+
* Raises when calling `lock!` in a dirty record.
|
518
610
|
|
519
|
-
|
611
|
+
*Rafael Mendonça França*
|
520
612
|
|
521
|
-
|
613
|
+
* Remove deprecated support to passing a class to `:class_name` on associations.
|
522
614
|
|
523
|
-
*
|
615
|
+
*Rafael Mendonça França*
|
524
616
|
|
525
|
-
|
617
|
+
* Remove deprecated argument `default` from `index_name_exists?`.
|
526
618
|
|
527
|
-
*
|
528
|
-
to fire database query only if relation has been changed.
|
619
|
+
*Rafael Mendonça França*
|
529
620
|
|
530
|
-
|
621
|
+
* Remove deprecated support to `quoted_id` when typecasting an Active Record object.
|
531
622
|
|
532
|
-
*
|
623
|
+
*Rafael Mendonça França*
|
533
624
|
|
534
|
-
*
|
535
|
-
|
625
|
+
* Fix `bin/rails db:setup` and `bin/rails db:test:prepare` create wrong
|
626
|
+
ar_internal_metadata's data for a test database.
|
536
627
|
|
537
|
-
|
628
|
+
Before:
|
629
|
+
```
|
630
|
+
$ RAILS_ENV=test rails dbconsole
|
631
|
+
> SELECT * FROM ar_internal_metadata;
|
632
|
+
key|value|created_at|updated_at
|
633
|
+
environment|development|2017-09-11 23:14:10.815679|2017-09-11 23:14:10.815679
|
634
|
+
```
|
538
635
|
|
539
|
-
|
636
|
+
After:
|
637
|
+
```
|
638
|
+
$ RAILS_ENV=test rails dbconsole
|
639
|
+
> SELECT * FROM ar_internal_metadata;
|
640
|
+
key|value|created_at|updated_at
|
641
|
+
environment|test|2017-09-11 23:14:10.815679|2017-09-11 23:14:10.815679
|
642
|
+
```
|
540
643
|
|
541
|
-
Fixes #
|
644
|
+
Fixes #26731.
|
542
645
|
|
543
646
|
*bogdanvlviv*
|
544
647
|
|
545
|
-
*
|
546
|
-
PostgreSQL.
|
547
|
-
|
548
|
-
*Edho Arief*
|
549
|
-
|
550
|
-
* Serialize JSON attribute value `nil` as SQL `NULL`, not JSON `null`.
|
648
|
+
* Fix longer sequence name detection for serial columns.
|
551
649
|
|
552
|
-
|
650
|
+
Fixes #28332.
|
553
651
|
|
554
|
-
*
|
555
|
-
to be updated is unchanged.
|
652
|
+
*Ryuta Kamizono*
|
556
653
|
|
557
|
-
|
654
|
+
* MySQL: Don't lose `auto_increment: true` in the `db/schema.rb`.
|
558
655
|
|
559
|
-
|
656
|
+
Fixes #30894.
|
560
657
|
|
561
|
-
*
|
658
|
+
*Ryuta Kamizono*
|
562
659
|
|
563
|
-
|
564
|
-
string keys. This was creating inconsistency with other details that are
|
565
|
-
added using the `Errors#add` method. It was also inconsistent with the
|
566
|
-
`Errors#messages` storage.
|
660
|
+
* Fix `COUNT(DISTINCT ...)` for `GROUP BY` with `ORDER BY` and `LIMIT`.
|
567
661
|
|
568
|
-
|
569
|
-
cause a small breaking change because in those cases the details could
|
570
|
-
be accessed as strings keys but now it can not.
|
662
|
+
Fixes #30886.
|
571
663
|
|
572
|
-
|
664
|
+
*Ryuta Kamizono*
|
573
665
|
|
574
|
-
|
666
|
+
* PostgreSQL `tsrange` now preserves subsecond precision.
|
575
667
|
|
576
|
-
|
577
|
-
in
|
668
|
+
PostgreSQL 9.1+ introduced range types, and Rails added support for using
|
669
|
+
this datatype in Active Record. However, the serialization of
|
670
|
+
`PostgreSQL::OID::Range` was incomplete, because it did not properly
|
671
|
+
cast the bounds that make up the range. This led to subseconds being
|
672
|
+
dropped in SQL commands:
|
578
673
|
|
579
|
-
|
674
|
+
Before:
|
580
675
|
|
581
|
-
|
676
|
+
connection.type_cast(tsrange.serialize(range_value))
|
677
|
+
# => "[2010-01-01 13:30:00 UTC,2011-02-02 19:30:00 UTC)"
|
582
678
|
|
583
|
-
|
584
|
-
saying the connection is closed rather than an undefined method error message.
|
679
|
+
Now:
|
585
680
|
|
586
|
-
|
681
|
+
connection.type_cast(tsrange.serialize(range_value))
|
682
|
+
# => "[2010-01-01 13:30:00.670277,2011-02-02 19:30:00.745125)"
|
587
683
|
|
588
|
-
*
|
589
|
-
in the array.
|
684
|
+
*Thomas Cannon*
|
590
685
|
|
591
|
-
|
686
|
+
* Passing a `Set` to `Relation#where` now behaves the same as passing an
|
687
|
+
array.
|
592
688
|
|
593
689
|
*Sean Griffin*
|
594
690
|
|
595
|
-
*
|
596
|
-
`after_initialize` callbacks are run.
|
691
|
+
* Use given algorithm while removing index from database.
|
597
692
|
|
598
|
-
Fixes #
|
693
|
+
Fixes #24190.
|
599
694
|
|
600
|
-
*
|
695
|
+
*Mehmet Emin İNAÇ*
|
601
696
|
|
602
|
-
*
|
603
|
-
|
697
|
+
* Update payload names for `sql.active_record` instrumentation to be
|
698
|
+
more descriptive.
|
604
699
|
|
605
|
-
|
700
|
+
Fixes #30586.
|
606
701
|
|
607
|
-
*
|
702
|
+
*Jeremy Green*
|
608
703
|
|
609
|
-
|
704
|
+
* Add new error class `LockWaitTimeout` which will be raised
|
705
|
+
when lock wait timeout exceeded.
|
610
706
|
|
611
|
-
*
|
612
|
-
the `pluck` method on a collection.
|
707
|
+
*Gabriel Courtemanche*
|
613
708
|
|
614
|
-
|
709
|
+
* Remove deprecated `#migration_keys`.
|
615
710
|
|
616
711
|
*Ryuta Kamizono*
|
617
712
|
|
618
|
-
*
|
619
|
-
consistency with other types.
|
713
|
+
* Automatically guess the inverse associations for STI.
|
620
714
|
|
621
|
-
|
622
|
-
data-change statements such as INSERT or UPDATE. If strict mode is not
|
623
|
-
in effect, MySQL inserts adjusted values for invalid or missing values
|
624
|
-
and produces warnings.
|
715
|
+
*Yuichiro Kaneko*
|
625
716
|
|
626
|
-
|
627
|
-
using_strict(false) do
|
628
|
-
with_mysql_not_null_table do |klass|
|
629
|
-
record = klass.new
|
630
|
-
assert_nil record.non_null_integer
|
631
|
-
assert_nil record.non_null_string
|
632
|
-
assert_nil record.non_null_text
|
633
|
-
assert_nil record.non_null_blob
|
717
|
+
* Ensure `sum` honors `distinct` on `has_many :through` associations.
|
634
718
|
|
635
|
-
|
636
|
-
record.reload
|
719
|
+
Fixes #16791.
|
637
720
|
|
638
|
-
|
639
|
-
assert_equal "", record.non_null_string
|
640
|
-
assert_equal "", record.non_null_text
|
641
|
-
assert_equal "", record.non_null_blob
|
642
|
-
end
|
643
|
-
end
|
644
|
-
end
|
721
|
+
*Aaron Wortham*
|
645
722
|
|
646
|
-
|
723
|
+
* Add `binary` fixture helper method.
|
647
724
|
|
648
|
-
*
|
725
|
+
*Atsushi Yoshida*
|
726
|
+
|
727
|
+
* When using `Relation#or`, extract the common conditions and put them before the OR condition.
|
728
|
+
|
729
|
+
*Maxime Handfield Lapointe*
|
730
|
+
|
731
|
+
* `Relation#or` now accepts two relations who have different values for
|
732
|
+
`references` only, as `references` can be implicitly called by `where`.
|
733
|
+
|
734
|
+
Fixes #29411.
|
649
735
|
|
650
|
-
*
|
651
|
-
successfully rolled back when the column was given and invalid column
|
652
|
-
type.
|
736
|
+
*Sean Griffin*
|
653
737
|
|
654
|
-
|
738
|
+
* `ApplicationRecord` is no longer generated when generating models. If you
|
739
|
+
need to generate it, it can be created with `rails g application_record`.
|
655
740
|
|
656
|
-
*
|
741
|
+
*Lisa Ugray*
|
657
742
|
|
658
|
-
*
|
743
|
+
* Fix `COUNT(DISTINCT ...)` with `ORDER BY` and `LIMIT` to keep the existing select list.
|
659
744
|
|
660
745
|
*Ryuta Kamizono*
|
661
746
|
|
662
|
-
*
|
663
|
-
|
747
|
+
* When a `has_one` association is destroyed by `dependent: destroy`,
|
748
|
+
`destroyed_by_association` will now be set to the reflection, matching the
|
749
|
+
behaviour of `has_many` associations.
|
750
|
+
|
751
|
+
*Lisa Ugray*
|
752
|
+
|
753
|
+
* Fix `unscoped(where: [columns])` removing the wrong bind values.
|
754
|
+
|
755
|
+
When the `where` is called on a relation after a `or`, unscoping the column of that later `where` removed
|
756
|
+
bind values used by the `or` instead. (possibly other cases too)
|
757
|
+
|
758
|
+
```
|
759
|
+
Post.where(id: 1).or(Post.where(id: 2)).where(foo: 3).unscope(where: :foo).to_sql
|
760
|
+
# Currently:
|
761
|
+
# SELECT "posts".* FROM "posts" WHERE ("posts"."id" = 2 OR "posts"."id" = 3)
|
762
|
+
# With fix:
|
763
|
+
# SELECT "posts".* FROM "posts" WHERE ("posts"."id" = 1 OR "posts"."id" = 2)
|
764
|
+
```
|
664
765
|
|
665
766
|
*Maxime Handfield Lapointe*
|
666
767
|
|
667
|
-
*
|
668
|
-
|
768
|
+
* Values constructed using multi-parameter assignment will now use the
|
769
|
+
post-type-cast value for rendering in single-field form inputs.
|
669
770
|
|
670
|
-
*
|
771
|
+
*Sean Griffin*
|
671
772
|
|
672
|
-
*
|
673
|
-
|
773
|
+
* `Relation#joins` is no longer affected by the target model's
|
774
|
+
`current_scope`, with the exception of `unscoped`.
|
674
775
|
|
675
|
-
Fixes #
|
776
|
+
Fixes #29338.
|
676
777
|
|
677
778
|
*Sean Griffin*
|
678
779
|
|
679
|
-
*
|
780
|
+
* Change sqlite3 boolean serialization to use 1 and 0.
|
680
781
|
|
681
|
-
|
782
|
+
SQLite natively recognizes 1 and 0 as true and false, but does not natively
|
783
|
+
recognize 't' and 'f' as was previously serialized.
|
682
784
|
|
683
|
-
|
684
|
-
|
785
|
+
This change in serialization requires a migration of stored boolean data
|
786
|
+
for SQLite databases, so it's implemented behind a configuration flag
|
787
|
+
whose default false value is deprecated.
|
685
788
|
|
686
|
-
*
|
789
|
+
*Lisa Ugray*
|
687
790
|
|
688
|
-
*
|
791
|
+
* Skip query caching when working with batches of records (`find_each`, `find_in_batches`,
|
792
|
+
`in_batches`).
|
689
793
|
|
690
|
-
|
794
|
+
Previously, records would be fetched in batches, but all records would be retained in memory
|
795
|
+
until the end of the request or job.
|
691
796
|
|
692
|
-
*
|
797
|
+
*Eugene Kenny*
|
693
798
|
|
694
|
-
|
799
|
+
* Prevent errors raised by `sql.active_record` notification subscribers from being converted into
|
800
|
+
`ActiveRecord::StatementInvalid` exceptions.
|
695
801
|
|
696
|
-
*
|
802
|
+
*Dennis Taylor*
|
697
803
|
|
698
|
-
|
699
|
-
git diffing.
|
804
|
+
* Fix eager loading/preloading association with scope including joins.
|
700
805
|
|
701
|
-
Fixes #
|
806
|
+
Fixes #28324.
|
702
807
|
|
703
|
-
*
|
808
|
+
*Ryuta Kamizono*
|
704
809
|
|
705
|
-
*
|
706
|
-
the current `error_on_ignored_order`.
|
810
|
+
* Fix transactions to apply state to child transactions.
|
707
811
|
|
708
|
-
|
812
|
+
Previously, if you had a nested transaction and the outer transaction was rolledback, the record from the
|
813
|
+
inner transaction would still be marked as persisted.
|
709
814
|
|
710
|
-
|
815
|
+
This change fixes that by applying the state of the parent transaction to the child transaction when the
|
816
|
+
parent transaction is rolledback. This will correctly mark records from the inner transaction as not persisted.
|
711
817
|
|
712
|
-
|
713
|
-
# ...
|
714
|
-
end
|
818
|
+
*Eileen M. Uchitelle*, *Aaron Patterson*
|
715
819
|
|
716
|
-
|
820
|
+
* Deprecate `set_state` method in `TransactionState`.
|
717
821
|
|
718
|
-
|
822
|
+
Deprecated the `set_state` method in favor of setting the state via specific methods. If you need to mark the
|
823
|
+
state of the transaction you can now use `rollback!`, `commit!` or `nullify!` instead of
|
824
|
+
`set_state(:rolledback)`, `set_state(:committed)`, or `set_state(nil)`.
|
719
825
|
|
720
|
-
*
|
721
|
-
the hash keys after calling a calculation method like `count`.
|
826
|
+
*Eileen M. Uchitelle*, *Aaron Patterson*
|
722
827
|
|
723
|
-
|
828
|
+
* Deprecate delegating to `arel` in `Relation`.
|
724
829
|
|
725
|
-
*
|
830
|
+
*Ryuta Kamizono*
|
726
831
|
|
727
|
-
*
|
728
|
-
|
729
|
-
effectively 17 to leave room for the default "...".
|
730
|
-
Also call `#parameterize` before `#truncate` and make the
|
731
|
-
`separator: /-/` to maximize the information included in the
|
732
|
-
output.
|
832
|
+
* Query cache was unavailable when entering the `ActiveRecord::Base.cache` block
|
833
|
+
without being connected.
|
733
834
|
|
734
|
-
|
835
|
+
*Tsukasa Oishi*
|
735
836
|
|
736
|
-
|
837
|
+
* Previously, when building records using a `has_many :through` association,
|
838
|
+
if the child records were deleted before the parent was saved, they would
|
839
|
+
still be persisted. Now, if child records are deleted before the parent is saved
|
840
|
+
on a `has_many :through` association, the child records will not be persisted.
|
737
841
|
|
738
|
-
*
|
739
|
-
same connection to two threads.
|
842
|
+
*Tobias Kraze*
|
740
843
|
|
741
|
-
|
844
|
+
* Merging two relations representing nested joins no longer transforms the joins of
|
845
|
+
the merged relation into LEFT OUTER JOIN.
|
742
846
|
|
743
|
-
|
847
|
+
Example:
|
744
848
|
|
745
|
-
|
746
|
-
|
747
|
-
|
849
|
+
```
|
850
|
+
Author.joins(:posts).merge(Post.joins(:comments))
|
851
|
+
# Before the change:
|
852
|
+
#=> SELECT ... FROM authors INNER JOIN posts ON ... LEFT OUTER JOIN comments ON...
|
748
853
|
|
749
|
-
|
854
|
+
# After the change:
|
855
|
+
#=> SELECT ... FROM authors INNER JOIN posts ON ... INNER JOIN comments ON...
|
856
|
+
```
|
750
857
|
|
751
|
-
*
|
752
|
-
`ActiveRecord::Base.connection_id=`.
|
858
|
+
*Maxime Handfield Lapointe*
|
753
859
|
|
754
|
-
|
860
|
+
* `ActiveRecord::Persistence#touch` does not work well when optimistic locking enabled and
|
861
|
+
`locking_column`, without default value, is null in the database.
|
755
862
|
|
756
|
-
*
|
863
|
+
*bogdanvlviv*
|
757
864
|
|
758
|
-
|
865
|
+
* Fix destroying existing object does not work well when optimistic locking enabled and
|
866
|
+
`locking_column` is null in the database.
|
759
867
|
|
760
|
-
*
|
868
|
+
*bogdanvlviv*
|
869
|
+
|
870
|
+
* Use bulk INSERT to insert fixtures for better performance.
|
871
|
+
|
872
|
+
*Kir Shatrov*
|
873
|
+
|
874
|
+
* Prevent creation of bind param if casted value is nil.
|
875
|
+
|
876
|
+
*Ryuta Kamizono*
|
877
|
+
|
878
|
+
* Deprecate passing arguments and block at the same time to `count` and `sum` in `ActiveRecord::Calculations`.
|
879
|
+
|
880
|
+
*Ryuta Kamizono*
|
761
881
|
|
762
|
-
*
|
763
|
-
|
882
|
+
* Loading model schema from database is now thread-safe.
|
883
|
+
|
884
|
+
Fixes #28589.
|
885
|
+
|
886
|
+
*Vikrant Chaudhary*, *David Abdemoulaie*
|
887
|
+
|
888
|
+
* Add `ActiveRecord::Base#cache_version` to support recyclable cache keys via the new versioned entries
|
889
|
+
in `ActiveSupport::Cache`. This also means that `ActiveRecord::Base#cache_key` will now return a stable key
|
890
|
+
that does not include a timestamp any more.
|
891
|
+
|
892
|
+
NOTE: This feature is turned off by default, and `#cache_key` will still return cache keys with timestamps
|
893
|
+
until you set `ActiveRecord::Base.cache_versioning = true`. That's the setting for all new apps on Rails 5.2+
|
894
|
+
|
895
|
+
*DHH*
|
896
|
+
|
897
|
+
* Respect `SchemaDumper.ignore_tables` in rake tasks for databases structure dump.
|
898
|
+
|
899
|
+
*Rusty Geldmacher*, *Guillermo Iguaran*
|
900
|
+
|
901
|
+
* Add type caster to `RuntimeReflection#alias_name`.
|
902
|
+
|
903
|
+
Fixes #28959.
|
764
904
|
|
765
905
|
*Jon Moss*
|
766
906
|
|
767
|
-
*
|
768
|
-
adapter returns `''` instead of `nil`.
|
907
|
+
* Deprecate `supports_statement_cache?`.
|
769
908
|
|
770
|
-
*
|
909
|
+
*Ryuta Kamizono*
|
771
910
|
|
772
|
-
*
|
773
|
-
|
911
|
+
* Raise error `UnknownMigrationVersionError` on the movement of migrations
|
912
|
+
when the current migration does not exist.
|
774
913
|
|
775
|
-
*
|
914
|
+
*bogdanvlviv*
|
776
915
|
|
777
|
-
*
|
916
|
+
* Fix `bin/rails db:forward` first migration.
|
778
917
|
|
779
|
-
|
780
|
-
when invoking `psql` to make sure errors are not suppressed.
|
918
|
+
*bogdanvlviv*
|
781
919
|
|
782
|
-
|
920
|
+
* Support Descending Indexes for MySQL.
|
783
921
|
|
784
|
-
|
922
|
+
MySQL 8.0.1 and higher supports descending indexes: `DESC` in an index definition is no longer ignored.
|
923
|
+
See https://dev.mysql.com/doc/refman/8.0/en/descending-indexes.html.
|
924
|
+
|
925
|
+
*Ryuta Kamizono*
|
785
926
|
|
786
|
-
|
927
|
+
* Fix inconsistency with changed attributes when overriding Active Record attribute reader.
|
787
928
|
|
788
|
-
*
|
929
|
+
*bogdanvlviv*
|
930
|
+
|
931
|
+
* When calling the dynamic fixture accessor method with no arguments, it now returns all fixtures of this type.
|
932
|
+
Previously this method always returned an empty array.
|
933
|
+
|
934
|
+
*Kevin McPhillips*
|
789
935
|
|
790
936
|
|
791
|
-
Please check [5-
|
937
|
+
Please check [5-1-stable](https://github.com/rails/rails/blob/5-1-stable/activerecord/CHANGELOG.md) for previous changes.
|