activerecord 4.2.0 → 5.2.8.1
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 +640 -928
- data/MIT-LICENSE +2 -2
- data/README.rdoc +10 -11
- data/examples/performance.rb +32 -31
- data/examples/simple.rb +5 -4
- data/lib/active_record/aggregations.rb +264 -247
- data/lib/active_record/association_relation.rb +24 -6
- data/lib/active_record/associations/alias_tracker.rb +29 -35
- data/lib/active_record/associations/association.rb +87 -41
- data/lib/active_record/associations/association_scope.rb +106 -132
- data/lib/active_record/associations/belongs_to_association.rb +55 -36
- data/lib/active_record/associations/belongs_to_polymorphic_association.rb +8 -8
- data/lib/active_record/associations/builder/association.rb +29 -38
- data/lib/active_record/associations/builder/belongs_to.rb +77 -30
- data/lib/active_record/associations/builder/collection_association.rb +14 -23
- data/lib/active_record/associations/builder/has_and_belongs_to_many.rb +50 -39
- data/lib/active_record/associations/builder/has_many.rb +6 -4
- data/lib/active_record/associations/builder/has_one.rb +13 -6
- data/lib/active_record/associations/builder/singular_association.rb +15 -11
- data/lib/active_record/associations/collection_association.rb +145 -266
- data/lib/active_record/associations/collection_proxy.rb +242 -138
- data/lib/active_record/associations/foreign_association.rb +13 -0
- data/lib/active_record/associations/has_many_association.rb +35 -75
- data/lib/active_record/associations/has_many_through_association.rb +51 -69
- data/lib/active_record/associations/has_one_association.rb +39 -24
- data/lib/active_record/associations/has_one_through_association.rb +18 -9
- data/lib/active_record/associations/join_dependency/join_association.rb +40 -81
- data/lib/active_record/associations/join_dependency/join_base.rb +10 -9
- data/lib/active_record/associations/join_dependency/join_part.rb +12 -12
- data/lib/active_record/associations/join_dependency.rb +134 -154
- data/lib/active_record/associations/preloader/association.rb +85 -116
- data/lib/active_record/associations/preloader/through_association.rb +85 -74
- data/lib/active_record/associations/preloader.rb +83 -93
- data/lib/active_record/associations/singular_association.rb +27 -40
- data/lib/active_record/associations/through_association.rb +48 -23
- data/lib/active_record/associations.rb +1732 -1596
- data/lib/active_record/attribute_assignment.rb +58 -182
- data/lib/active_record/attribute_decorators.rb +39 -15
- data/lib/active_record/attribute_methods/before_type_cast.rb +12 -5
- data/lib/active_record/attribute_methods/dirty.rb +94 -125
- data/lib/active_record/attribute_methods/primary_key.rb +86 -71
- data/lib/active_record/attribute_methods/query.rb +4 -2
- data/lib/active_record/attribute_methods/read.rb +45 -63
- data/lib/active_record/attribute_methods/serialization.rb +40 -20
- data/lib/active_record/attribute_methods/time_zone_conversion.rb +62 -36
- data/lib/active_record/attribute_methods/write.rb +31 -46
- data/lib/active_record/attribute_methods.rb +170 -117
- data/lib/active_record/attributes.rb +201 -74
- data/lib/active_record/autosave_association.rb +118 -45
- data/lib/active_record/base.rb +60 -48
- data/lib/active_record/callbacks.rb +97 -57
- data/lib/active_record/coders/json.rb +3 -1
- data/lib/active_record/coders/yaml_column.rb +37 -13
- data/lib/active_record/collection_cache_key.rb +53 -0
- data/lib/active_record/connection_adapters/abstract/connection_pool.rb +712 -284
- data/lib/active_record/connection_adapters/abstract/database_limits.rb +10 -5
- data/lib/active_record/connection_adapters/abstract/database_statements.rb +254 -87
- data/lib/active_record/connection_adapters/abstract/query_cache.rb +72 -22
- data/lib/active_record/connection_adapters/abstract/quoting.rb +119 -52
- data/lib/active_record/connection_adapters/abstract/savepoints.rb +6 -4
- data/lib/active_record/connection_adapters/abstract/schema_creation.rb +67 -46
- data/lib/active_record/connection_adapters/abstract/schema_definitions.rb +328 -217
- data/lib/active_record/connection_adapters/abstract/schema_dumper.rb +81 -36
- data/lib/active_record/connection_adapters/abstract/schema_statements.rb +617 -212
- data/lib/active_record/connection_adapters/abstract/transaction.rb +139 -75
- data/lib/active_record/connection_adapters/abstract_adapter.rb +332 -191
- data/lib/active_record/connection_adapters/abstract_mysql_adapter.rb +567 -563
- data/lib/active_record/connection_adapters/column.rb +50 -41
- data/lib/active_record/connection_adapters/connection_specification.rb +147 -135
- data/lib/active_record/connection_adapters/determine_if_preparable_visitor.rb +33 -0
- data/lib/active_record/connection_adapters/mysql/column.rb +27 -0
- data/lib/active_record/connection_adapters/mysql/database_statements.rb +140 -0
- data/lib/active_record/connection_adapters/mysql/explain_pretty_printer.rb +72 -0
- data/lib/active_record/connection_adapters/mysql/quoting.rb +44 -0
- data/lib/active_record/connection_adapters/mysql/schema_creation.rb +73 -0
- data/lib/active_record/connection_adapters/mysql/schema_definitions.rb +87 -0
- data/lib/active_record/connection_adapters/mysql/schema_dumper.rb +80 -0
- data/lib/active_record/connection_adapters/mysql/schema_statements.rb +148 -0
- data/lib/active_record/connection_adapters/mysql/type_metadata.rb +35 -0
- data/lib/active_record/connection_adapters/mysql2_adapter.rb +42 -195
- data/lib/active_record/connection_adapters/postgresql/column.rb +35 -11
- data/lib/active_record/connection_adapters/postgresql/database_statements.rb +46 -115
- data/lib/active_record/connection_adapters/postgresql/explain_pretty_printer.rb +44 -0
- data/lib/active_record/connection_adapters/postgresql/oid/array.rb +50 -57
- data/lib/active_record/connection_adapters/postgresql/oid/bit.rb +10 -6
- data/lib/active_record/connection_adapters/postgresql/oid/bit_varying.rb +2 -0
- data/lib/active_record/connection_adapters/postgresql/oid/bytea.rb +5 -2
- data/lib/active_record/connection_adapters/postgresql/oid/cidr.rb +5 -1
- data/lib/active_record/connection_adapters/postgresql/oid/date.rb +13 -1
- data/lib/active_record/connection_adapters/postgresql/oid/date_time.rb +9 -13
- data/lib/active_record/connection_adapters/postgresql/oid/decimal.rb +3 -1
- data/lib/active_record/connection_adapters/postgresql/oid/enum.rb +7 -3
- data/lib/active_record/connection_adapters/postgresql/oid/hstore.rb +31 -19
- 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 +45 -0
- data/lib/active_record/connection_adapters/postgresql/oid/money.rb +7 -9
- data/lib/active_record/connection_adapters/postgresql/oid/{integer.rb → oid.rb} +6 -2
- data/lib/active_record/connection_adapters/postgresql/oid/point.rb +33 -11
- data/lib/active_record/connection_adapters/postgresql/oid/range.rb +52 -34
- data/lib/active_record/connection_adapters/postgresql/oid/specialized_string.rb +4 -1
- data/lib/active_record/connection_adapters/postgresql/oid/type_map_initializer.rb +65 -51
- data/lib/active_record/connection_adapters/postgresql/oid/uuid.rb +5 -3
- data/lib/active_record/connection_adapters/postgresql/oid/vector.rb +3 -1
- data/lib/active_record/connection_adapters/postgresql/oid/xml.rb +3 -1
- data/lib/active_record/connection_adapters/postgresql/oid.rb +23 -25
- data/lib/active_record/connection_adapters/postgresql/quoting.rb +107 -47
- data/lib/active_record/connection_adapters/postgresql/referential_integrity.rb +27 -14
- data/lib/active_record/connection_adapters/postgresql/schema_creation.rb +65 -0
- data/lib/active_record/connection_adapters/postgresql/schema_definitions.rb +144 -90
- data/lib/active_record/connection_adapters/postgresql/schema_dumper.rb +50 -0
- data/lib/active_record/connection_adapters/postgresql/schema_statements.rb +466 -280
- data/lib/active_record/connection_adapters/postgresql/type_metadata.rb +39 -0
- data/lib/active_record/connection_adapters/postgresql/utils.rb +12 -8
- data/lib/active_record/connection_adapters/postgresql_adapter.rb +439 -330
- data/lib/active_record/connection_adapters/schema_cache.rb +48 -24
- data/lib/active_record/connection_adapters/sql_type_metadata.rb +34 -0
- data/lib/active_record/connection_adapters/sqlite3/explain_pretty_printer.rb +21 -0
- data/lib/active_record/connection_adapters/sqlite3/quoting.rb +67 -0
- data/lib/active_record/connection_adapters/sqlite3/schema_creation.rb +17 -0
- data/lib/active_record/connection_adapters/sqlite3/schema_definitions.rb +19 -0
- data/lib/active_record/connection_adapters/sqlite3/schema_dumper.rb +18 -0
- data/lib/active_record/connection_adapters/sqlite3/schema_statements.rb +106 -0
- data/lib/active_record/connection_adapters/sqlite3_adapter.rb +269 -324
- data/lib/active_record/connection_adapters/statement_pool.rb +34 -13
- data/lib/active_record/connection_handling.rb +40 -27
- data/lib/active_record/core.rb +205 -202
- data/lib/active_record/counter_cache.rb +80 -37
- data/lib/active_record/define_callbacks.rb +22 -0
- data/lib/active_record/dynamic_matchers.rb +87 -105
- data/lib/active_record/enum.rb +136 -90
- data/lib/active_record/errors.rb +180 -52
- data/lib/active_record/explain.rb +23 -11
- data/lib/active_record/explain_registry.rb +4 -2
- data/lib/active_record/explain_subscriber.rb +11 -6
- data/lib/active_record/fixture_set/file.rb +35 -9
- data/lib/active_record/fixtures.rb +193 -135
- data/lib/active_record/gem_version.rb +5 -3
- data/lib/active_record/inheritance.rb +148 -112
- data/lib/active_record/integration.rb +70 -28
- data/lib/active_record/internal_metadata.rb +45 -0
- data/lib/active_record/legacy_yaml_adapter.rb +48 -0
- data/lib/active_record/locale/en.yml +3 -2
- data/lib/active_record/locking/optimistic.rb +92 -98
- data/lib/active_record/locking/pessimistic.rb +15 -3
- data/lib/active_record/log_subscriber.rb +95 -33
- data/lib/active_record/migration/command_recorder.rb +133 -90
- data/lib/active_record/migration/compatibility.rb +217 -0
- data/lib/active_record/migration/join_table.rb +8 -6
- data/lib/active_record/migration.rb +594 -267
- data/lib/active_record/model_schema.rb +292 -111
- data/lib/active_record/nested_attributes.rb +266 -214
- data/lib/active_record/no_touching.rb +8 -2
- data/lib/active_record/null_relation.rb +24 -37
- data/lib/active_record/persistence.rb +350 -119
- data/lib/active_record/query_cache.rb +13 -24
- data/lib/active_record/querying.rb +19 -17
- data/lib/active_record/railtie.rb +117 -35
- data/lib/active_record/railties/console_sandbox.rb +2 -0
- data/lib/active_record/railties/controller_runtime.rb +9 -3
- data/lib/active_record/railties/databases.rake +160 -174
- data/lib/active_record/readonly_attributes.rb +5 -4
- data/lib/active_record/reflection.rb +447 -288
- data/lib/active_record/relation/batches/batch_enumerator.rb +69 -0
- data/lib/active_record/relation/batches.rb +204 -55
- data/lib/active_record/relation/calculations.rb +259 -244
- data/lib/active_record/relation/delegation.rb +67 -60
- data/lib/active_record/relation/finder_methods.rb +290 -253
- data/lib/active_record/relation/from_clause.rb +26 -0
- data/lib/active_record/relation/merger.rb +91 -68
- data/lib/active_record/relation/predicate_builder/array_handler.rb +24 -23
- data/lib/active_record/relation/predicate_builder/association_query_value.rb +46 -0
- data/lib/active_record/relation/predicate_builder/base_handler.rb +19 -0
- data/lib/active_record/relation/predicate_builder/basic_object_handler.rb +20 -0
- data/lib/active_record/relation/predicate_builder/polymorphic_array_value.rb +56 -0
- data/lib/active_record/relation/predicate_builder/range_handler.rb +42 -0
- data/lib/active_record/relation/predicate_builder/relation_handler.rb +7 -1
- data/lib/active_record/relation/predicate_builder.rb +118 -92
- data/lib/active_record/relation/query_attribute.rb +45 -0
- data/lib/active_record/relation/query_methods.rb +446 -389
- data/lib/active_record/relation/record_fetch_warning.rb +51 -0
- data/lib/active_record/relation/spawn_methods.rb +18 -16
- data/lib/active_record/relation/where_clause.rb +186 -0
- data/lib/active_record/relation/where_clause_factory.rb +34 -0
- data/lib/active_record/relation.rb +287 -339
- data/lib/active_record/result.rb +54 -36
- data/lib/active_record/runtime_registry.rb +6 -4
- data/lib/active_record/sanitization.rb +155 -124
- data/lib/active_record/schema.rb +30 -24
- data/lib/active_record/schema_dumper.rb +91 -87
- data/lib/active_record/schema_migration.rb +19 -19
- data/lib/active_record/scoping/default.rb +102 -84
- data/lib/active_record/scoping/named.rb +81 -32
- data/lib/active_record/scoping.rb +45 -26
- data/lib/active_record/secure_token.rb +40 -0
- data/lib/active_record/serialization.rb +5 -5
- data/lib/active_record/statement_cache.rb +45 -35
- data/lib/active_record/store.rb +42 -36
- data/lib/active_record/suppressor.rb +61 -0
- data/lib/active_record/table_metadata.rb +82 -0
- data/lib/active_record/tasks/database_tasks.rb +136 -95
- data/lib/active_record/tasks/mysql_database_tasks.rb +59 -89
- data/lib/active_record/tasks/postgresql_database_tasks.rb +84 -31
- data/lib/active_record/tasks/sqlite_database_tasks.rb +44 -16
- data/lib/active_record/timestamp.rb +70 -38
- data/lib/active_record/touch_later.rb +64 -0
- data/lib/active_record/transactions.rb +208 -123
- data/lib/active_record/translation.rb +2 -0
- data/lib/active_record/type/adapter_specific_registry.rb +136 -0
- data/lib/active_record/type/date.rb +4 -41
- data/lib/active_record/type/date_time.rb +4 -38
- data/lib/active_record/type/decimal_without_scale.rb +6 -2
- data/lib/active_record/type/hash_lookup_type_map.rb +13 -5
- data/lib/active_record/type/internal/timezone.rb +17 -0
- data/lib/active_record/type/json.rb +30 -0
- data/lib/active_record/type/serialized.rb +30 -15
- data/lib/active_record/type/text.rb +2 -2
- data/lib/active_record/type/time.rb +11 -16
- data/lib/active_record/type/type_map.rb +15 -17
- data/lib/active_record/type/unsigned_integer.rb +9 -7
- data/lib/active_record/type.rb +79 -23
- data/lib/active_record/type_caster/connection.rb +33 -0
- data/lib/active_record/type_caster/map.rb +23 -0
- data/lib/active_record/type_caster.rb +9 -0
- data/lib/active_record/validations/absence.rb +25 -0
- data/lib/active_record/validations/associated.rb +13 -4
- data/lib/active_record/validations/length.rb +26 -0
- data/lib/active_record/validations/presence.rb +14 -13
- data/lib/active_record/validations/uniqueness.rb +41 -32
- data/lib/active_record/validations.rb +38 -35
- data/lib/active_record/version.rb +3 -1
- data/lib/active_record.rb +36 -21
- data/lib/rails/generators/active_record/application_record/application_record_generator.rb +27 -0
- data/lib/rails/generators/active_record/application_record/templates/application_record.rb.tt +5 -0
- data/lib/rails/generators/active_record/migration/migration_generator.rb +43 -35
- data/lib/rails/generators/active_record/migration/templates/{create_table_migration.rb → create_table_migration.rb.tt} +8 -6
- data/lib/rails/generators/active_record/migration/templates/{migration.rb → migration.rb.tt} +8 -7
- data/lib/rails/generators/active_record/migration.rb +18 -1
- data/lib/rails/generators/active_record/model/model_generator.rb +18 -22
- data/lib/rails/generators/active_record/model/templates/{model.rb → model.rb.tt} +3 -0
- data/lib/rails/generators/active_record.rb +7 -5
- metadata +77 -53
- data/lib/active_record/associations/preloader/belongs_to.rb +0 -17
- data/lib/active_record/associations/preloader/collection_association.rb +0 -24
- data/lib/active_record/associations/preloader/has_many.rb +0 -17
- data/lib/active_record/associations/preloader/has_many_through.rb +0 -19
- data/lib/active_record/associations/preloader/has_one.rb +0 -23
- data/lib/active_record/associations/preloader/has_one_through.rb +0 -9
- data/lib/active_record/associations/preloader/singular_association.rb +0 -21
- data/lib/active_record/attribute.rb +0 -149
- data/lib/active_record/attribute_set/builder.rb +0 -86
- data/lib/active_record/attribute_set.rb +0 -77
- data/lib/active_record/connection_adapters/mysql_adapter.rb +0 -491
- data/lib/active_record/connection_adapters/postgresql/array_parser.rb +0 -93
- data/lib/active_record/connection_adapters/postgresql/oid/float.rb +0 -21
- data/lib/active_record/connection_adapters/postgresql/oid/infinity.rb +0 -13
- data/lib/active_record/connection_adapters/postgresql/oid/json.rb +0 -35
- data/lib/active_record/connection_adapters/postgresql/oid/time.rb +0 -11
- data/lib/active_record/railties/jdbcmysql_error.rb +0 -16
- data/lib/active_record/serializers/xml_serializer.rb +0 -193
- data/lib/active_record/type/big_integer.rb +0 -13
- data/lib/active_record/type/binary.rb +0 -50
- data/lib/active_record/type/boolean.rb +0 -30
- data/lib/active_record/type/decimal.rb +0 -40
- data/lib/active_record/type/decorator.rb +0 -14
- data/lib/active_record/type/float.rb +0 -19
- data/lib/active_record/type/integer.rb +0 -55
- data/lib/active_record/type/mutable.rb +0 -16
- data/lib/active_record/type/numeric.rb +0 -36
- data/lib/active_record/type/string.rb +0 -36
- data/lib/active_record/type/time_value.rb +0 -38
- data/lib/active_record/type/value.rb +0 -101
- /data/lib/rails/generators/active_record/model/templates/{module.rb → module.rb.tt} +0 -0
data/CHANGELOG.md
CHANGED
@@ -1,1372 +1,1084 @@
|
|
1
|
-
|
2
|
-
will recreate tables even if they have dependent objects (like foreign keys).
|
3
|
-
`db/schema.rb` now uses `force: :cascade`. This makes it possible to
|
4
|
-
reload the schema when foreign keys are in place.
|
1
|
+
## Rails 5.2.8.1 (July 12, 2022) ##
|
5
2
|
|
6
|
-
|
3
|
+
* Change ActiveRecord::Coders::YAMLColumn default to safe_load
|
7
4
|
|
8
|
-
|
9
|
-
|
10
|
-
|
5
|
+
This adds two new configuration options The configuration options are as
|
6
|
+
follows:
|
7
|
+
|
8
|
+
* `config.active_storage.use_yaml_unsafe_load`
|
9
|
+
|
10
|
+
When set to true, this configuration option tells Rails to use the old
|
11
|
+
"unsafe" YAML loading strategy, maintaining the existing behavior but leaving
|
12
|
+
the possible escalation vulnerability in place. Setting this option to true
|
13
|
+
is *not* recommended, but can aid in upgrading.
|
14
|
+
|
15
|
+
* `config.active_record.yaml_column_permitted_classes`
|
16
|
+
|
17
|
+
The "safe YAML" loading method does not allow all classes to be deserialized
|
18
|
+
by default. This option allows you to specify classes deemed "safe" in your
|
19
|
+
application. For example, if your application uses Symbol and Time in
|
20
|
+
serialized data, you can add Symbol and Time to the allowed list as follows:
|
21
|
+
|
22
|
+
```
|
23
|
+
config.active_record.yaml_column_permitted_classes = [Symbol, Date, Time]
|
24
|
+
```
|
11
25
|
|
12
|
-
|
26
|
+
[CVE-2022-32224]
|
13
27
|
|
14
|
-
*Yves Senn*
|
15
28
|
|
16
|
-
|
29
|
+
## Rails 5.2.8 (May 09, 2022) ##
|
17
30
|
|
18
|
-
|
19
|
-
|
20
|
-
* Add `foreign_type` option to `has_one` and `has_many` association macros.
|
21
|
-
|
22
|
-
This option enables to define the column name of associated object's type for polymorphic associations.
|
23
|
-
|
24
|
-
*Ulisses Almeida, Kassio Borges*
|
25
|
-
|
26
|
-
* `add_timestamps` and `remove_timestamps` now properly reversible with
|
27
|
-
options.
|
28
|
-
|
29
|
-
*Noam Gagliardi-Rabinovich*
|
30
|
-
|
31
|
-
* Bring back `db:test:prepare` to synchronize the test database schema.
|
32
|
-
|
33
|
-
Manual synchronization using `bin/rake db:test:prepare` is required
|
34
|
-
when a migration is rolled-back, edited and reapplied.
|
31
|
+
* No changes.
|
35
32
|
|
36
|
-
`ActiveRecord::Base.maintain_test_schema` now uses `db:test:prepare`
|
37
|
-
to synchronize the schema. Plugins can use this task as a hook to
|
38
|
-
provide custom behavior after the schema has been loaded.
|
39
33
|
|
40
|
-
|
34
|
+
## Rails 5.2.7.1 (April 26, 2022) ##
|
41
35
|
|
42
|
-
|
36
|
+
* No changes.
|
43
37
|
|
44
|
-
*Yves Senn*
|
45
38
|
|
46
|
-
|
39
|
+
## Rails 5.2.7 (March 10, 2022) ##
|
47
40
|
|
48
|
-
|
41
|
+
* No changes.
|
49
42
|
|
50
|
-
*arthurnn*
|
51
43
|
|
52
|
-
|
44
|
+
## Rails 5.2.6.3 (March 08, 2022) ##
|
53
45
|
|
54
|
-
|
46
|
+
* No changes.
|
55
47
|
|
56
|
-
*Sean Griffin*
|
57
|
-
|
58
|
-
* Make it possible to access fixtures excluded by a `default_scope`.
|
59
|
-
|
60
|
-
*Yves Senn*
|
61
|
-
|
62
|
-
* Fix preloading of associations with a scope containing joins along with
|
63
|
-
conditions on the joined association.
|
64
48
|
|
65
|
-
|
49
|
+
## Rails 5.2.6.2 (February 11, 2022) ##
|
66
50
|
|
67
|
-
*
|
51
|
+
* No changes.
|
68
52
|
|
69
|
-
*Cody Cutrer*
|
70
53
|
|
71
|
-
|
72
|
-
the owner has been saved so that the proxy is not cached without the
|
73
|
-
owner's id.
|
54
|
+
## Rails 5.2.6.1 (February 11, 2022) ##
|
74
55
|
|
75
|
-
|
56
|
+
* No changes.
|
76
57
|
|
77
|
-
* `ActiveRecord::ReadOnlyRecord` now has a descriptive message.
|
78
58
|
|
79
|
-
|
59
|
+
## Rails 5.2.6 (May 05, 2021) ##
|
80
60
|
|
81
|
-
*
|
61
|
+
* No changes.
|
82
62
|
|
83
|
-
Fixes #11036.
|
84
63
|
|
85
|
-
|
64
|
+
## Rails 5.2.5 (March 26, 2021) ##
|
86
65
|
|
87
|
-
*
|
88
|
-
|
89
|
-
*Ted O'Meara*
|
90
|
-
|
91
|
-
* Deprecate `sanitize_sql_hash_for_conditions` without replacement. Using a
|
92
|
-
`Relation` for performing queries and updates is the prefered API.
|
93
|
-
|
94
|
-
*Sean Griffin*
|
66
|
+
* No changes.
|
95
67
|
|
96
|
-
* Queries now properly type cast values that are part of a join statement,
|
97
|
-
even when using type decorators such as `serialize`.
|
98
68
|
|
99
|
-
|
69
|
+
## Rails 5.2.4.6 (May 05, 2021) ##
|
100
70
|
|
101
|
-
*
|
102
|
-
in an endless loop.
|
71
|
+
* No changes.
|
103
72
|
|
104
|
-
Fixes #17402.
|
105
73
|
|
106
|
-
|
74
|
+
## Rails 5.2.4.5 (February 10, 2021) ##
|
107
75
|
|
108
|
-
*
|
76
|
+
* Fix possible DoS vector in PostgreSQL money type
|
109
77
|
|
110
|
-
|
78
|
+
Carefully crafted input can cause a DoS via the regular expressions used
|
79
|
+
for validating the money format in the PostgreSQL adapter. This patch
|
80
|
+
fixes the regexp.
|
111
81
|
|
112
|
-
|
82
|
+
Thanks to @dee-see from Hackerone for this patch!
|
113
83
|
|
114
|
-
|
115
|
-
|
116
|
-
* Fix `Relation.rewhere` to work with Range values.
|
117
|
-
|
118
|
-
*Dan Olson*
|
119
|
-
|
120
|
-
* `AR::UnknownAttributeError` now includes the class name of a record.
|
121
|
-
|
122
|
-
User.new(name: "Yuki Nishijima", project_attributes: {name: "kaminari"})
|
123
|
-
# => ActiveRecord::UnknownAttributeError: unknown attribute 'name' for User.
|
124
|
-
|
125
|
-
*Yuki Nishijima*
|
126
|
-
|
127
|
-
* Fix a regression causing `after_create` callbacks to run before associated
|
128
|
-
records are autosaved.
|
129
|
-
|
130
|
-
Fixes #17209.
|
131
|
-
|
132
|
-
*Agis Anastasopoulos*
|
133
|
-
|
134
|
-
* Honor overridden `rack.test` in Rack environment for the connection
|
135
|
-
management middleware.
|
136
|
-
|
137
|
-
*Simon Eskildsen*
|
138
|
-
|
139
|
-
* Add a truncate method to the connection.
|
84
|
+
[CVE-2021-22880]
|
140
85
|
|
141
86
|
*Aaron Patterson*
|
142
87
|
|
143
|
-
* Don't autosave unchanged has_one through records.
|
144
|
-
|
145
|
-
*Alan Kennedy*, *Steve Parrington*
|
146
|
-
|
147
|
-
* Do not dump foreign keys for ignored tables.
|
148
|
-
|
149
|
-
*Yves Senn*
|
150
|
-
|
151
|
-
* PostgreSQL adapter correctly dumps foreign keys targeting tables
|
152
|
-
outside the schema search path.
|
153
|
-
|
154
|
-
Fixes #16907.
|
155
|
-
|
156
|
-
*Matthew Draper*, *Yves Senn*
|
157
|
-
|
158
|
-
* When a thread is killed, rollback the active transaction, instead of
|
159
|
-
committing it during the stack unwind. Previously, we could commit half-
|
160
|
-
completed work. This fix only works for Ruby 2.0+; on 1.9, we can't
|
161
|
-
distinguish a thread kill from an ordinary non-local (block) return, so must
|
162
|
-
default to committing.
|
163
|
-
|
164
|
-
*Chris Hanks*
|
165
|
-
|
166
|
-
* A `NullRelation` should represent nothing. This fixes a bug where
|
167
|
-
`Comment.where(post_id: Post.none)` returned a non-empty result.
|
168
|
-
|
169
|
-
Fixes #15176.
|
170
|
-
|
171
|
-
*Matthew Draper*, *Yves Senn*
|
172
|
-
|
173
|
-
* Include default column limits in schema.rb. Allows defaults to be changed
|
174
|
-
in the future without affecting old migrations that assumed old defaults.
|
175
|
-
|
176
|
-
*Jeremy Kemper*
|
177
|
-
|
178
|
-
* MySQL: schema.rb now includes TEXT and BLOB column limits.
|
179
|
-
|
180
|
-
*Jeremy Kemper*
|
181
|
-
|
182
|
-
* MySQL: correct LONGTEXT and LONGBLOB limits from 2GB to their true 4GB.
|
183
|
-
|
184
|
-
*Jeremy Kemper*
|
185
|
-
|
186
|
-
* SQLite3Adapter now checks for views in `table_exists?`. Fixes #14041.
|
187
|
-
|
188
|
-
*Girish Sonawane*
|
189
|
-
|
190
|
-
* Introduce `connection.supports_views?` to check whether the current adapter
|
191
|
-
has support for SQL views. Connection adapters should define this method.
|
192
|
-
|
193
|
-
*Yves Senn*
|
194
|
-
|
195
|
-
* Allow included modules to override association methods.
|
196
|
-
|
197
|
-
Fixes #16684.
|
198
|
-
|
199
|
-
*Yves Senn*
|
200
|
-
|
201
|
-
* Schema loading rake tasks (like `db:schema:load` and `db:setup`) maintain
|
202
|
-
the database connection to the current environment.
|
203
|
-
|
204
|
-
Fixes #16757.
|
205
|
-
|
206
|
-
*Joshua Cody*, *Yves Senn*
|
207
|
-
|
208
|
-
* MySQL: set the connection collation along with the charset.
|
209
|
-
|
210
|
-
Sets the connection collation to the database collation configured in
|
211
|
-
database.yml. Otherwise, `SET NAMES utf8mb4` will use the default
|
212
|
-
collation for that charset (utf8mb4_general_ci) when you may have chosen
|
213
|
-
a different collation, like utf8mb4_unicode_ci.
|
214
|
-
|
215
|
-
This only applies to literal string comparisons, not column values, so it
|
216
|
-
is unlikely to affect you.
|
217
|
-
|
218
|
-
*Jeremy Kemper*
|
219
|
-
|
220
|
-
* `default_sequence_name` from the PostgreSQL adapter returns a `String`.
|
221
|
-
|
222
|
-
*Yves Senn*
|
223
|
-
|
224
|
-
* Fix a regression where whitespaces were stripped from DISTINCT queries in
|
225
|
-
PostgreSQL.
|
226
|
-
|
227
|
-
*Agis Anastasopoulos*
|
228
88
|
|
229
|
-
|
89
|
+
## Rails 5.2.4.4 (September 09, 2020) ##
|
230
90
|
|
231
|
-
*
|
232
|
-
passed as a lambda with an arity of one.
|
91
|
+
* No changes.
|
233
92
|
|
234
|
-
Fixes #16128.
|
235
93
|
|
236
|
-
|
94
|
+
## Rails 5.2.4.3 (May 18, 2020) ##
|
237
95
|
|
238
|
-
*
|
96
|
+
* No changes.
|
239
97
|
|
240
|
-
|
98
|
+
## Rails 5.2.4.2 (March 19, 2020) ##
|
241
99
|
|
242
|
-
|
100
|
+
* No changes.
|
243
101
|
|
244
|
-
* Currently, Active Record rescues any errors raised within
|
245
|
-
`after_rollback`/`after_create` callbacks and prints them to the logs.
|
246
|
-
Future versions of Rails will not rescue these errors anymore and
|
247
|
-
just bubble them up like the other callbacks.
|
248
102
|
|
249
|
-
|
103
|
+
## Rails 5.2.4.1 (December 18, 2019) ##
|
250
104
|
|
251
|
-
|
252
|
-
|
253
|
-
# Do not swallow errors in after_commit/after_rollback callbacks.
|
254
|
-
config.active_record.raise_in_transactional_callbacks = true
|
255
|
-
|
256
|
-
Fixes #13460.
|
257
|
-
|
258
|
-
*arthurnn*
|
259
|
-
|
260
|
-
* Fix an issue where custom accessor methods (such as those generated by
|
261
|
-
`enum`) with the same name as a global method are incorrectly overridden
|
262
|
-
when subclassing.
|
263
|
-
|
264
|
-
Fixes #16288.
|
265
|
-
|
266
|
-
*Godfrey Chan*
|
267
|
-
|
268
|
-
* `*_was` and `changes` now work correctly for in-place attribute changes as
|
269
|
-
well.
|
270
|
-
|
271
|
-
*Sean Griffin*
|
272
|
-
|
273
|
-
* Fix regression on `after_commit` that did not fire with nested transactions.
|
274
|
-
|
275
|
-
Fixes #16425.
|
276
|
-
|
277
|
-
*arthurnn*
|
278
|
-
|
279
|
-
* Do not try to write timestamps when a table has no timestamps columns.
|
280
|
-
|
281
|
-
Fixes #8813.
|
282
|
-
|
283
|
-
*Sergey Potapov*
|
284
|
-
|
285
|
-
* `index_exists?` with `:name` option does verify specified columns.
|
286
|
-
|
287
|
-
Example:
|
288
|
-
|
289
|
-
add_index :articles, :title, name: "idx_title"
|
290
|
-
|
291
|
-
# Before:
|
292
|
-
index_exists? :articles, :title, name: "idx_title" # => `true`
|
293
|
-
index_exists? :articles, :body, name: "idx_title" # => `true`
|
294
|
-
|
295
|
-
# After:
|
296
|
-
index_exists? :articles, :title, name: "idx_title" # => `true`
|
297
|
-
index_exists? :articles, :body, name: "idx_title" # => `false`
|
298
|
-
|
299
|
-
*Yves Senn*, *Matthew Draper*
|
300
|
-
|
301
|
-
* `add_timestamps` and `t.timestamps` now require you to pass the `:null` option.
|
302
|
-
Not passing the option is deprecated but the default is still `null: true`.
|
303
|
-
With Rails 5 this will change to `null: false`.
|
304
|
-
|
305
|
-
*Sean Griffin*
|
306
|
-
|
307
|
-
* When calling `update_columns` on a record that is not persisted, the error
|
308
|
-
message now reflects whether that object is a new record or has been
|
309
|
-
destroyed.
|
310
|
-
|
311
|
-
*Lachlan Sylvester*
|
312
|
-
|
313
|
-
* Define `id_was` to get the previous value of the primary key.
|
314
|
-
|
315
|
-
Currently when we call `id_was` and we have a custom primary key name,
|
316
|
-
Active Record will return the current value of the primary key. This
|
317
|
-
makes it impossible to correctly do an update operation if you change the
|
318
|
-
id.
|
319
|
-
|
320
|
-
Fixes #16413.
|
105
|
+
* No changes.
|
321
106
|
|
322
|
-
*Rafael Mendonça França*
|
323
|
-
|
324
|
-
* Deprecate `DatabaseTasks.load_schema` to act on the current connection.
|
325
|
-
Use `.load_schema_current` instead. In the future `load_schema` will
|
326
|
-
require the `configuration` to act on as an argument.
|
327
|
-
|
328
|
-
*Yves Senn*
|
329
|
-
|
330
|
-
* Fix automatic maintaining test schema to properly handle sql structure
|
331
|
-
schema format.
|
332
107
|
|
333
|
-
|
108
|
+
## Rails 5.2.4 (November 27, 2019) ##
|
334
109
|
|
335
|
-
|
110
|
+
* Fix circular `autosave: true` causes invalid records to be saved.
|
336
111
|
|
337
|
-
|
112
|
+
Prior to the fix, when there was a circular series of `autosave: true`
|
113
|
+
associations, the callback for a `has_many` association was run while
|
114
|
+
another instance of the same callback on the same association hadn't
|
115
|
+
finished running. When control returned to the first instance of the
|
116
|
+
callback, the instance variable had changed, and subsequent associated
|
117
|
+
records weren't saved correctly. Specifically, the ID field for the
|
118
|
+
`belongs_to` corresponding to the `has_many` was `nil`.
|
338
119
|
|
339
|
-
|
120
|
+
Fixes #28080.
|
340
121
|
|
341
|
-
*
|
122
|
+
*Larry Reid*
|
342
123
|
|
343
|
-
|
344
|
-
source so it has been deprecated. Code that used `source_macro`
|
345
|
-
was removed in #16353.
|
124
|
+
* PostgreSQL: Fix GROUP BY with ORDER BY virtual count attribute.
|
346
125
|
|
347
|
-
|
126
|
+
Fixes #36022.
|
348
127
|
|
349
|
-
*
|
350
|
-
|
351
|
-
Fixes #16295.
|
128
|
+
*Ryuta Kamizono*
|
352
129
|
|
353
|
-
|
130
|
+
* Fix sqlite3 collation parsing when using decimal columns.
|
354
131
|
|
355
|
-
*
|
132
|
+
*Martin R. Schuster*
|
356
133
|
|
357
|
-
|
134
|
+
* Make ActiveRecord `ConnectionPool.connections` method thread-safe.
|
358
135
|
|
359
|
-
|
360
|
-
t.jsonb :meta_data
|
361
|
-
end
|
136
|
+
Fixes #36465.
|
362
137
|
|
363
|
-
*
|
138
|
+
*Jeff Doering*
|
364
139
|
|
365
|
-
* `
|
140
|
+
* Assign all attributes before calling `build` to ensure the child record is visible in
|
141
|
+
`before_add` and `after_add` callbacks for `has_many :through` associations.
|
366
142
|
|
367
|
-
|
143
|
+
Fixes #33249.
|
368
144
|
|
369
|
-
*
|
370
|
-
`DROP DEFAULT` instead of a `DEFAULT NULL` query.
|
145
|
+
*Ryan H. Kerr*
|
371
146
|
|
372
|
-
Fixes #16261.
|
373
147
|
|
374
|
-
|
148
|
+
## Rails 5.2.3 (March 27, 2019) ##
|
375
149
|
|
376
|
-
*
|
377
|
-
and `add_reference`.
|
150
|
+
* Fix different `count` calculation when using `size` with manual `select` with DISTINCT.
|
378
151
|
|
379
|
-
|
152
|
+
Fixes #35214.
|
380
153
|
|
381
|
-
|
382
|
-
t.references :station, type: :uuid
|
383
|
-
end
|
154
|
+
*Juani Villarejo*
|
384
155
|
|
385
|
-
|
156
|
+
* Fix prepared statements caching to be enabled even when query caching is enabled.
|
386
157
|
|
387
|
-
*
|
388
|
-
This matches the existing behavior of HABTM associations.
|
158
|
+
*Ryuta Kamizono*
|
389
159
|
|
390
|
-
|
160
|
+
* Don't allow `where` with invalid value matches to nil values.
|
391
161
|
|
392
|
-
|
162
|
+
Fixes #33624.
|
393
163
|
|
394
|
-
*
|
395
|
-
a class.
|
164
|
+
*Ryuta Kamizono*
|
396
165
|
|
397
|
-
|
166
|
+
* Restore an ability that class level `update` without giving ids.
|
398
167
|
|
399
|
-
|
168
|
+
Fixes #34743.
|
400
169
|
|
401
|
-
*
|
170
|
+
*Ryuta Kamizono*
|
402
171
|
|
403
|
-
*
|
172
|
+
* Fix join table column quoting with SQLite.
|
404
173
|
|
405
|
-
|
406
|
-
the second attribute. It will now return a hash as per previous versions.
|
174
|
+
*Gannon McGibbon*
|
407
175
|
|
408
|
-
|
176
|
+
* Ensure that `delete_all` on collection proxy returns affected count.
|
409
177
|
|
410
|
-
|
411
|
-
serialize :comment, JSON
|
412
|
-
end
|
413
|
-
|
414
|
-
class Comment
|
415
|
-
include ActiveModel::Model
|
416
|
-
attr_accessor :category, :text
|
417
|
-
end
|
418
|
-
|
419
|
-
post = Post.create!
|
420
|
-
post.comment = Comment.new(category: "Animals", text: "This is a comment about squirrels.")
|
421
|
-
post.save!
|
178
|
+
*Ryuta Kamizono*
|
422
179
|
|
423
|
-
|
424
|
-
post.comment # => {"category"=>"Animals", "text"=>"This is a comment about squirrels."}
|
180
|
+
* Reset scope after delete on collection association to clear stale offsets of removed records.
|
425
181
|
|
426
|
-
|
427
|
-
post.comment # => "#<Comment:0x007f80ab48ff98>"
|
182
|
+
*Gannon McGibbon*
|
428
183
|
|
429
|
-
# 4.1 after
|
430
|
-
post.comment # => {"category"=>"Animals", "text"=>"This is a comment about squirrels."}
|
431
184
|
|
432
|
-
|
433
|
-
new `ActiveRecord::Coders::JSON` coder which delegates its `dump/load` to
|
434
|
-
`ActiveSupport::JSON.encode/decode`. This ensures special objects are dumped
|
435
|
-
correctly using the `#as_json` hook.
|
185
|
+
## Rails 5.2.2.1 (March 11, 2019) ##
|
436
186
|
|
437
|
-
|
438
|
-
([example](https://gist.github.com/jenncoop/8c4142bbe59da77daa63)).
|
187
|
+
* No changes.
|
439
188
|
|
440
|
-
Fixes #15594.
|
441
189
|
|
442
|
-
|
190
|
+
## Rails 5.2.2 (December 04, 2018) ##
|
443
191
|
|
444
|
-
* Do not
|
192
|
+
* Do not ignore the scoping with query methods in the scope block.
|
445
193
|
|
446
|
-
|
194
|
+
*Ryuta Kamizono*
|
447
195
|
|
448
|
-
|
196
|
+
* Allow aliased attributes to be used in `#update_columns` and `#update`.
|
449
197
|
|
450
|
-
*
|
451
|
-
counter cache if one exists.
|
198
|
+
*Gannon McGibbon*
|
452
199
|
|
453
|
-
|
200
|
+
* Allow spaces in postgres table names.
|
454
201
|
|
455
|
-
|
456
|
-
|
202
|
+
Fixes issue where "user post" is misinterpreted as "\"user\".\"post\"" when quoting table names with the postgres
|
203
|
+
adapter.
|
457
204
|
|
458
|
-
|
205
|
+
*Gannon McGibbon*
|
459
206
|
|
460
|
-
|
207
|
+
* Cached columns_hash fields should be excluded from ResultSet#column_types
|
461
208
|
|
462
|
-
|
463
|
-
|
209
|
+
PR #34528 addresses the inconsistent behaviour when attribute is defined for an ignored column. The following test
|
210
|
+
was passing for SQLite and MySQL, but failed for PostgreSQL:
|
464
211
|
|
465
|
-
|
212
|
+
```ruby
|
213
|
+
class DeveloperName < ActiveRecord::Type::String
|
214
|
+
def deserialize(value)
|
215
|
+
"Developer: #{value}"
|
216
|
+
end
|
217
|
+
end
|
466
218
|
|
467
|
-
|
468
|
-
|
219
|
+
class AttributedDeveloper < ActiveRecord::Base
|
220
|
+
self.table_name = "developers"
|
469
221
|
|
470
|
-
|
222
|
+
attribute :name, DeveloperName.new
|
471
223
|
|
472
|
-
|
473
|
-
|
224
|
+
self.ignored_columns += ["name"]
|
225
|
+
end
|
474
226
|
|
475
|
-
|
227
|
+
developer = AttributedDeveloper.create
|
228
|
+
developer.update_column :name, "name"
|
476
229
|
|
477
|
-
|
478
|
-
|
479
|
-
|
480
|
-
string starting with a non-digit.
|
230
|
+
loaded_developer = AttributedDeveloper.where(id: developer.id).select("*").first
|
231
|
+
puts loaded_developer.name # should be "Developer: name" but it's just "name"
|
232
|
+
```
|
481
233
|
|
482
|
-
|
234
|
+
*Dmitry Tsepelev*
|
483
235
|
|
484
|
-
|
236
|
+
* Values of enum are frozen, raising an error when attempting to modify them.
|
485
237
|
|
486
|
-
*
|
238
|
+
*Emmanuel Byrd*
|
487
239
|
|
488
|
-
*
|
489
|
-
|
240
|
+
* `update_columns` now correctly raises `ActiveModel::MissingAttributeError`
|
241
|
+
if the attribute does not exist.
|
490
242
|
|
491
243
|
*Sean Griffin*
|
492
244
|
|
493
|
-
*
|
494
|
-
(Call to `count` generated invalid SQL.)
|
495
|
-
|
496
|
-
*Cade Truitt*
|
497
|
-
|
498
|
-
* After a successful `reload`, `new_record?` is always false.
|
499
|
-
|
500
|
-
Fixes #12101.
|
501
|
-
|
502
|
-
*Matthew Draper*
|
503
|
-
|
504
|
-
* PostgreSQL renaming table doesn't attempt to rename non existent sequences.
|
505
|
-
|
506
|
-
*Abdelkader Boudih*
|
507
|
-
|
508
|
-
* Move 'dependent: :destroy' handling for `belongs_to`
|
509
|
-
from `before_destroy` to `after_destroy` callback chain
|
245
|
+
* Do not use prepared statement in queries that have a large number of binds.
|
510
246
|
|
511
|
-
|
512
|
-
|
513
|
-
*Ivan Antropov*
|
514
|
-
|
515
|
-
* Detect in-place modifications on String attributes.
|
516
|
-
|
517
|
-
Before this change, an attribute modified in-place had to be marked as
|
518
|
-
changed in order for it to be persisted in the database. Now it is no longer
|
519
|
-
required.
|
520
|
-
|
521
|
-
Before:
|
522
|
-
|
523
|
-
user = User.first
|
524
|
-
user.name << ' Griffin'
|
525
|
-
user.name_will_change!
|
526
|
-
user.save
|
527
|
-
user.reload.name # => "Sean Griffin"
|
528
|
-
|
529
|
-
After:
|
530
|
-
|
531
|
-
user = User.first
|
532
|
-
user.name << ' Griffin'
|
533
|
-
user.save
|
534
|
-
user.reload.name # => "Sean Griffin"
|
535
|
-
|
536
|
-
*Sean Griffin*
|
247
|
+
*Ryuta Kamizono*
|
537
248
|
|
538
|
-
*
|
539
|
-
is invalid.
|
249
|
+
* Fix query cache to load before first request.
|
540
250
|
|
541
|
-
*
|
251
|
+
*Eileen M. Uchitelle*
|
542
252
|
|
543
|
-
*
|
544
|
-
a part of `schema.rb`. This is supported by Mysql2Adapter, MysqlAdapter
|
545
|
-
and PostgreSQLAdapter.
|
253
|
+
* Fix collection cache key with limit and custom select to avoid ambiguous timestamp column error.
|
546
254
|
|
547
|
-
|
548
|
-
[foreigner](https://github.com/matthuhiggins/foreigner).
|
255
|
+
Fixes #33056.
|
549
256
|
|
550
|
-
|
257
|
+
*Federico Martinez*
|
551
258
|
|
552
|
-
|
553
|
-
add_foreign_key :articles, :authors
|
554
|
-
remove_foreign_key :articles, :authors
|
259
|
+
* Fix duplicated record creation when using nested attributes with `create_with`.
|
555
260
|
|
556
|
-
*
|
261
|
+
*Darwin Wu*
|
557
262
|
|
558
|
-
* Fix
|
559
|
-
key. `'id'` will no longer be part of the attributes hash.
|
263
|
+
* Fix regression setting children record in parent `before_save` callback.
|
560
264
|
|
561
|
-
*
|
265
|
+
*Guo Xiang Tan*
|
562
266
|
|
563
|
-
*
|
564
|
-
broken and inconsistent.
|
267
|
+
* Prevent leaking of user's DB credentials on `rails db:create` failure.
|
565
268
|
|
566
|
-
*
|
269
|
+
*bogdanvlviv*
|
567
270
|
|
568
|
-
*
|
271
|
+
* Clear mutation tracker before continuing the around callbacks.
|
569
272
|
|
570
|
-
|
273
|
+
*Yuya Tanaka*
|
571
274
|
|
572
|
-
|
275
|
+
* Prevent deadlocks when waiting for connection from pool.
|
573
276
|
|
574
|
-
*
|
575
|
-
would fail numericality validation, regardless of the old value. Previously
|
576
|
-
this would only occur if the old value was 0.
|
277
|
+
*Brent Wheeldon*
|
577
278
|
|
578
|
-
|
279
|
+
* Avoid extra scoping when using `Relation#update` that was causing this method to change the current scope.
|
579
280
|
|
580
|
-
|
581
|
-
model.number = '5wibble'
|
582
|
-
model.number_changed? # => true
|
281
|
+
*Ryuta Kamizono*
|
583
282
|
|
584
|
-
|
283
|
+
* Fix numericality validator not to be affected by custom getter.
|
585
284
|
|
586
|
-
*
|
285
|
+
*Ryuta Kamizono*
|
587
286
|
|
588
|
-
*
|
589
|
-
The attribute hash is fully replaced. The record is put into the same state
|
590
|
-
as it would be with `Model.find(model.id)`.
|
287
|
+
* Fix bulk change table ignores comment option on PostgreSQL.
|
591
288
|
|
592
|
-
*
|
289
|
+
*Yoshiyuki Kinjo*
|
593
290
|
|
594
|
-
* The object returned from `select_all` must respond to `column_types`.
|
595
|
-
If this is not the case a `NoMethodError` is raised.
|
596
291
|
|
597
|
-
|
292
|
+
## Rails 5.2.1.1 (November 27, 2018) ##
|
598
293
|
|
599
|
-
*
|
294
|
+
* No changes.
|
600
295
|
|
601
|
-
*Sean Griffin*
|
602
296
|
|
603
|
-
|
297
|
+
## Rails 5.2.1 (August 07, 2018) ##
|
604
298
|
|
605
|
-
|
299
|
+
* PostgreSQL: Support new relkind for partitioned tables.
|
606
300
|
|
607
|
-
|
301
|
+
Fixes #33008.
|
608
302
|
|
609
|
-
*
|
303
|
+
*Yannick Schutz*
|
610
304
|
|
611
|
-
*
|
612
|
-
are part of the URI structure, not the actual host.
|
305
|
+
* Rollback parent transaction when children fails to update.
|
613
306
|
|
614
|
-
|
307
|
+
*Guillaume Malette*
|
615
308
|
|
616
|
-
|
309
|
+
* Fix default value for MySQL time types with specified precision.
|
617
310
|
|
618
|
-
*
|
619
|
-
through association are new.
|
311
|
+
*Nikolay Kondratyev*
|
620
312
|
|
621
|
-
|
313
|
+
* Fix `touch` option to behave consistently with `Persistence#touch` method.
|
622
314
|
|
623
|
-
*
|
624
|
-
Serialized attributes on ActiveRecord models will no longer save when
|
625
|
-
unchanged.
|
315
|
+
*Ryuta Kamizono*
|
626
316
|
|
627
|
-
|
317
|
+
* Fix `save` in `after_create_commit` won't invoke extra `after_create_commit`.
|
628
318
|
|
629
|
-
|
319
|
+
Fixes #32831.
|
630
320
|
|
631
|
-
*
|
632
|
-
name.
|
321
|
+
*Ryuta Kamizono*
|
633
322
|
|
634
|
-
|
323
|
+
* Fix logic on disabling commit callbacks so they are not called unexpectedly when errors occur.
|
635
324
|
|
636
|
-
*
|
325
|
+
*Brian Durand*
|
637
326
|
|
638
|
-
*
|
327
|
+
* Fix parent record should not get saved with duplicate children records.
|
639
328
|
|
640
|
-
|
329
|
+
Fixes #32940.
|
641
330
|
|
642
|
-
*
|
331
|
+
*Santosh Wadghule*
|
643
332
|
|
644
|
-
|
333
|
+
* Fix that association's after_touch is not called with counter cache.
|
645
334
|
|
646
|
-
|
647
|
-
`Enumerable#find` does.
|
335
|
+
Fixes #31559.
|
648
336
|
|
649
|
-
|
337
|
+
*Ryuta Kamizono*
|
650
338
|
|
651
|
-
|
339
|
+
* `becomes` should clear the mutation tracker which is created in `after_initialize`.
|
652
340
|
|
653
|
-
|
341
|
+
Fixes #32867.
|
654
342
|
|
655
|
-
|
343
|
+
*Ryuta Kamizono*
|
656
344
|
|
657
|
-
|
345
|
+
* Allow a belonging to parent object to be created from a new record.
|
658
346
|
|
659
|
-
*
|
660
|
-
`primary_key_prefix_type` configuration.
|
347
|
+
*Jolyon Pawlyn*
|
661
348
|
|
662
|
-
|
349
|
+
* Fix that building record with assigning multiple has_one associations
|
350
|
+
wrongly persists through record.
|
663
351
|
|
664
|
-
|
352
|
+
Fixes #32511.
|
665
353
|
|
666
|
-
*
|
354
|
+
*Sam DeCesare*
|
667
355
|
|
668
|
-
|
356
|
+
* Fix relation merging when one of the relations is going to skip the
|
357
|
+
query cache.
|
669
358
|
|
670
|
-
*
|
359
|
+
*James Williams*
|
671
360
|
|
672
|
-
* Baseclass becomes! subclass.
|
673
361
|
|
674
|
-
|
675
|
-
updated.
|
362
|
+
## Rails 5.2.0 (April 09, 2018) ##
|
676
363
|
|
677
|
-
|
364
|
+
* MySQL: Support mysql2 0.5.x.
|
678
365
|
|
679
|
-
*
|
366
|
+
*Aaron Stone*
|
680
367
|
|
681
|
-
*
|
682
|
-
`proper_table_name` instance method on `ActiveRecord::Migration` instead.
|
368
|
+
* Apply time column precision on assignment.
|
683
369
|
|
684
|
-
|
370
|
+
PR #20317 changed the behavior of datetime columns so that when they
|
371
|
+
have a specified precision then on assignment the value is rounded to
|
372
|
+
that precision. This behavior is now applied to time columns as well.
|
685
373
|
|
686
|
-
|
687
|
-
existing column.
|
374
|
+
Fixes #30301.
|
688
375
|
|
689
|
-
|
376
|
+
*Andrew White*
|
690
377
|
|
691
|
-
|
378
|
+
* Normalize time column values for SQLite database.
|
692
379
|
|
693
|
-
|
694
|
-
|
380
|
+
For legacy reasons, time columns in SQLite are stored as full datetimes
|
381
|
+
because until #24542 the quoting for time columns didn't remove the date
|
382
|
+
component. To ensure that values are consistent we now normalize the
|
383
|
+
date component to 2001-01-01 on reading and writing.
|
695
384
|
|
696
|
-
*
|
385
|
+
*Andrew White*
|
697
386
|
|
698
|
-
*
|
387
|
+
* Ensure that the date component is removed when quoting times.
|
699
388
|
|
700
|
-
|
389
|
+
PR #24542 altered the quoting for time columns so that the date component
|
390
|
+
was removed however it only removed it when it was 2001-01-01. Now the
|
391
|
+
date component is removed irrespective of what the date is.
|
701
392
|
|
702
|
-
*
|
703
|
-
columns.
|
393
|
+
*Andrew White*
|
704
394
|
|
705
|
-
|
395
|
+
* Fix `dependent: :destroy` issue for has_one/belongs_to relationship where
|
396
|
+
the parent class was getting deleted when the child was not.
|
706
397
|
|
707
|
-
|
398
|
+
Fixes #32022.
|
708
399
|
|
709
|
-
*
|
400
|
+
*Fernando Gorodscy*
|
710
401
|
|
711
|
-
*
|
402
|
+
* Whitelist `NULLS FIRST` and `NULLS LAST` in order clauses too.
|
712
403
|
|
713
|
-
*
|
404
|
+
*Xavier Noria*
|
714
405
|
|
715
|
-
*
|
406
|
+
* Fix that after commit callbacks on update does not triggered when optimistic locking is enabled.
|
716
407
|
|
717
|
-
*
|
408
|
+
*Ryuta Kamizono*
|
718
409
|
|
719
|
-
* Fix
|
720
|
-
|
410
|
+
* Fix `#columns_for_distinct` of MySQL and PostgreSQL to make
|
411
|
+
`ActiveRecord::FinderMethods#limited_ids_for` use correct primary key values
|
412
|
+
even if `ORDER BY` columns include other table's primary key.
|
721
413
|
|
722
|
-
|
414
|
+
Fixes #28364.
|
723
415
|
|
724
|
-
*
|
416
|
+
*Takumi Kagiyama*
|
725
417
|
|
726
|
-
|
418
|
+
* Make `reflection.klass` raise if `polymorphic?` not to be misused.
|
727
419
|
|
728
|
-
|
729
|
-
Fixes duplication in combination with `store_accessor`.
|
420
|
+
Fixes #31876.
|
730
421
|
|
731
|
-
|
422
|
+
*Ryuta Kamizono*
|
732
423
|
|
733
|
-
|
424
|
+
* PostgreSQL: Allow pg-1.0 gem to be used with Active Record.
|
734
425
|
|
735
|
-
*
|
426
|
+
*Lars Kanis*
|
736
427
|
|
737
|
-
|
428
|
+
* Deprecate `expand_hash_conditions_for_aggregates` without replacement.
|
429
|
+
Using a `Relation` for performing queries is the prefered API.
|
738
430
|
|
739
|
-
*
|
740
|
-
Fixing regression case, where redefining the same `has_and_belongs_to_many`
|
741
|
-
definition into a subclass would raise.
|
431
|
+
*Ryuta Kamizono*
|
742
432
|
|
743
|
-
|
433
|
+
* Fix not expanded problem when passing an Array object as argument to the where method using `composed_of` column.
|
744
434
|
|
745
|
-
|
435
|
+
```
|
436
|
+
david_balance = customers(:david).balance
|
437
|
+
Customer.where(balance: [david_balance]).to_sql
|
746
438
|
|
747
|
-
|
748
|
-
|
749
|
-
|
439
|
+
# Before: WHERE `customers`.`balance` = NULL
|
440
|
+
# After : WHERE `customers`.`balance` = 50
|
441
|
+
```
|
750
442
|
|
751
|
-
Fixes #
|
443
|
+
Fixes #31723.
|
752
444
|
|
753
|
-
*
|
445
|
+
*Yutaro Kanagawa*
|
754
446
|
|
755
|
-
* Fix
|
447
|
+
* Fix `count(:all)` with eager loading and having an order other than the driving table.
|
756
448
|
|
757
|
-
Fixes #
|
449
|
+
Fixes #31783.
|
758
450
|
|
759
|
-
*
|
451
|
+
*Ryuta Kamizono*
|
760
452
|
|
761
|
-
*
|
762
|
-
on a NullRelation should return a Hash.
|
453
|
+
* Clear the transaction state when an Active Record object is duped.
|
763
454
|
|
764
|
-
|
455
|
+
Fixes #31670.
|
765
456
|
|
766
|
-
*
|
767
|
-
`update_column`.
|
457
|
+
*Yuriy Ustushenko*
|
768
458
|
|
769
|
-
|
459
|
+
* Support for PostgreSQL foreign tables.
|
770
460
|
|
771
|
-
*
|
461
|
+
*fatkodima*
|
772
462
|
|
773
|
-
|
463
|
+
* Fix relation merger issue with `left_outer_joins`.
|
774
464
|
|
775
|
-
*
|
465
|
+
*Mehmet Emin İNAÇ*
|
776
466
|
|
777
|
-
*
|
467
|
+
* Don't allow destroyed object mutation after `save` or `save!` is called.
|
778
468
|
|
779
|
-
|
780
|
-
record will only be touched if the record was modified. This makes it
|
781
|
-
consistent with timestamp updating on the record itself.
|
469
|
+
*Ryuta Kamizono*
|
782
470
|
|
783
|
-
|
471
|
+
* Take into account association conditions when deleting through records.
|
784
472
|
|
785
|
-
|
786
|
-
table inside a schema.
|
473
|
+
Fixes #18424.
|
787
474
|
|
788
|
-
|
475
|
+
*Piotr Jakubowski*
|
789
476
|
|
790
|
-
|
477
|
+
* Fix nested `has_many :through` associations on unpersisted parent instances.
|
791
478
|
|
792
|
-
|
793
|
-
in all cases. Fixes inconsistencies when column types are sent outside of
|
794
|
-
`ActiveRecord`, such as for XML Serialization.
|
479
|
+
For example, if you have
|
795
480
|
|
796
|
-
|
481
|
+
class Post < ActiveRecord::Base
|
482
|
+
belongs_to :author
|
483
|
+
has_many :books, through: :author
|
484
|
+
has_many :subscriptions, through: :books
|
485
|
+
end
|
797
486
|
|
798
|
-
|
799
|
-
|
487
|
+
class Author < ActiveRecord::Base
|
488
|
+
has_one :post
|
489
|
+
has_many :books
|
490
|
+
has_many :subscriptions, through: :books
|
491
|
+
end
|
800
492
|
|
801
|
-
|
493
|
+
class Book < ActiveRecord::Base
|
494
|
+
belongs_to :author
|
495
|
+
has_many :subscriptions
|
496
|
+
end
|
802
497
|
|
803
|
-
|
804
|
-
|
498
|
+
class Subscription < ActiveRecord::Base
|
499
|
+
belongs_to :book
|
500
|
+
end
|
805
501
|
|
806
|
-
|
502
|
+
Before:
|
807
503
|
|
808
|
-
|
504
|
+
If `post` is not persisted, then `post.subscriptions` will be empty.
|
809
505
|
|
810
|
-
|
506
|
+
After:
|
811
507
|
|
812
|
-
|
813
|
-
|
508
|
+
If `post` is not persisted, then `post.subscriptions` can be set and used
|
509
|
+
just like it would if `post` were persisted.
|
814
510
|
|
815
|
-
|
816
|
-
records to be deleted.
|
511
|
+
Fixes #16313.
|
817
512
|
|
818
|
-
|
513
|
+
*Zoltan Kiss*
|
819
514
|
|
820
|
-
|
515
|
+
* Fixed inconsistency with `first(n)` when used with `limit()`.
|
516
|
+
The `first(n)` finder now respects the `limit()`, making it consistent
|
517
|
+
with `relation.to_a.first(n)`, and also with the behavior of `last(n)`.
|
821
518
|
|
822
|
-
|
823
|
-
their limit dropped from the schema.
|
519
|
+
Fixes #23979.
|
824
520
|
|
825
|
-
|
521
|
+
*Brian Christian*
|
826
522
|
|
827
|
-
|
523
|
+
* Use `count(:all)` in `HasManyAssociation#count_records` to prevent invalid
|
524
|
+
SQL queries for association counting.
|
828
525
|
|
829
|
-
*
|
830
|
-
association.
|
526
|
+
*Klas Eskilson*
|
831
527
|
|
832
|
-
|
528
|
+
* Fix to invoke callbacks when using `update_attribute`.
|
833
529
|
|
834
|
-
*
|
530
|
+
*Mike Busch*
|
835
531
|
|
836
|
-
* `
|
837
|
-
strings in column names as equal.
|
532
|
+
* Fix `count(:all)` to correctly work `distinct` with custom SELECT list.
|
838
533
|
|
839
|
-
|
840
|
-
placeholders for them in the generated SQL statement, which can make PostgreSQL
|
841
|
-
throw a `StatementInvalid` exception.
|
534
|
+
*Ryuta Kamizono*
|
842
535
|
|
843
|
-
|
536
|
+
* Using subselect for `delete_all` with `limit` or `offset`.
|
844
537
|
|
845
|
-
*
|
846
|
-
attributes defined in parent classes.
|
538
|
+
*Ryuta Kamizono*
|
847
539
|
|
848
|
-
|
540
|
+
* Undefine attribute methods on descendants when resetting column
|
541
|
+
information.
|
849
542
|
|
850
|
-
*
|
543
|
+
*Chris Salzberg*
|
851
544
|
|
852
|
-
*
|
545
|
+
* Log database query callers.
|
853
546
|
|
854
|
-
|
547
|
+
Add `verbose_query_logs` configuration option to display the caller
|
548
|
+
of database queries in the log to facilitate N+1 query resolution
|
549
|
+
and other debugging.
|
855
550
|
|
856
|
-
|
551
|
+
Enabled in development only for new and upgraded applications. Not
|
552
|
+
recommended for use in the production environment since it relies
|
553
|
+
on Ruby's `Kernel#caller_locations` which is fairly slow.
|
857
554
|
|
858
|
-
*
|
555
|
+
*Olivier Lacan*
|
859
556
|
|
860
|
-
|
861
|
-
PostgreSQL and are used by internal system catalogs. These field types
|
862
|
-
can sometimes show up in structure-sniffing queries that feature internal system
|
863
|
-
structures or with certain PostgreSQL extensions.
|
557
|
+
* Fix conflicts `counter_cache` with `touch: true` by optimistic locking.
|
864
558
|
|
865
|
-
|
559
|
+
```
|
560
|
+
# create_table :posts do |t|
|
561
|
+
# t.integer :comments_count, default: 0
|
562
|
+
# t.integer :lock_version
|
563
|
+
# t.timestamps
|
564
|
+
# end
|
565
|
+
class Post < ApplicationRecord
|
566
|
+
end
|
866
567
|
|
867
|
-
|
868
|
-
|
568
|
+
# create_table :comments do |t|
|
569
|
+
# t.belongs_to :post
|
570
|
+
# end
|
571
|
+
class Comment < ApplicationRecord
|
572
|
+
belongs_to :post, touch: true, counter_cache: true
|
573
|
+
end
|
574
|
+
```
|
869
575
|
|
870
576
|
Before:
|
871
|
-
|
872
|
-
|
873
|
-
|
577
|
+
```
|
578
|
+
post = Post.create!
|
579
|
+
# => begin transaction
|
580
|
+
INSERT INTO "posts" ("created_at", "updated_at", "lock_version")
|
581
|
+
VALUES ("2017-12-11 21:27:11.387397", "2017-12-11 21:27:11.387397", 0)
|
582
|
+
commit transaction
|
583
|
+
|
584
|
+
comment = Comment.create!(post: post)
|
585
|
+
# => begin transaction
|
586
|
+
INSERT INTO "comments" ("post_id") VALUES (1)
|
587
|
+
|
588
|
+
UPDATE "posts" SET "comments_count" = COALESCE("comments_count", 0) + 1,
|
589
|
+
"lock_version" = COALESCE("lock_version", 0) + 1 WHERE "posts"."id" = 1
|
590
|
+
|
591
|
+
UPDATE "posts" SET "updated_at" = '2017-12-11 21:27:11.398330',
|
592
|
+
"lock_version" = 1 WHERE "posts"."id" = 1 AND "posts"."lock_version" = 0
|
593
|
+
rollback transaction
|
594
|
+
# => ActiveRecord::StaleObjectError: Attempted to touch a stale object: Post.
|
595
|
+
|
596
|
+
Comment.take.destroy!
|
597
|
+
# => begin transaction
|
598
|
+
DELETE FROM "comments" WHERE "comments"."id" = 1
|
599
|
+
|
600
|
+
UPDATE "posts" SET "comments_count" = COALESCE("comments_count", 0) - 1,
|
601
|
+
"lock_version" = COALESCE("lock_version", 0) + 1 WHERE "posts"."id" = 1
|
602
|
+
|
603
|
+
UPDATE "posts" SET "updated_at" = '2017-12-11 21:42:47.785901',
|
604
|
+
"lock_version" = 1 WHERE "posts"."id" = 1 AND "posts"."lock_version" = 0
|
605
|
+
rollback transaction
|
606
|
+
# => ActiveRecord::StaleObjectError: Attempted to touch a stale object: Post.
|
607
|
+
```
|
874
608
|
|
875
609
|
After:
|
610
|
+
```
|
611
|
+
post = Post.create!
|
612
|
+
# => begin transaction
|
613
|
+
INSERT INTO "posts" ("created_at", "updated_at", "lock_version")
|
614
|
+
VALUES ("2017-12-11 21:27:11.387397", "2017-12-11 21:27:11.387397", 0)
|
615
|
+
commit transaction
|
876
616
|
|
877
|
-
|
878
|
-
|
879
|
-
|
880
|
-
*Innokenty Mikhailov*
|
881
|
-
|
882
|
-
* Allow the PostgreSQL adapter to handle bigserial primary key types again.
|
883
|
-
|
884
|
-
Fixes #10410.
|
885
|
-
|
886
|
-
*Patrick Robertson*
|
887
|
-
|
888
|
-
* Deprecate joining, eager loading and preloading of instance dependent
|
889
|
-
associations without replacement. These operations happen before instances
|
890
|
-
are created. The current behavior is unexpected and can result in broken
|
891
|
-
behavior.
|
892
|
-
|
893
|
-
Fixes #15024.
|
894
|
-
|
895
|
-
*Yves Senn*
|
896
|
-
|
897
|
-
* Fix `has_and_belongs_to_many` CollectionAssociation size calculations.
|
898
|
-
|
899
|
-
`has_and_belongs_to_many` should fall back to using the normal CollectionAssociation's
|
900
|
-
size calculation if the collection is not cached or loaded.
|
901
|
-
|
902
|
-
Fixes #14913, #14914.
|
903
|
-
|
904
|
-
*Fred Wu*
|
617
|
+
comment = Comment.create!(post: post)
|
618
|
+
# => begin transaction
|
619
|
+
INSERT INTO "comments" ("post_id") VALUES (1)
|
905
620
|
|
906
|
-
|
907
|
-
|
621
|
+
UPDATE "posts" SET "comments_count" = COALESCE("comments_count", 0) + 1,
|
622
|
+
"lock_version" = COALESCE("lock_version", 0) + 1,
|
623
|
+
"updated_at" = '2017-12-11 21:37:09.802642' WHERE "posts"."id" = 1
|
624
|
+
commit transaction
|
908
625
|
|
909
|
-
|
626
|
+
comment.destroy!
|
627
|
+
# => begin transaction
|
628
|
+
DELETE FROM "comments" WHERE "comments"."id" = 1
|
910
629
|
|
911
|
-
|
630
|
+
UPDATE "posts" SET "comments_count" = COALESCE("comments_count", 0) - 1,
|
631
|
+
"lock_version" = COALESCE("lock_version", 0) + 1,
|
632
|
+
"updated_at" = '2017-12-11 21:39:02.685520' WHERE "posts"."id" = 1
|
633
|
+
commit transaction
|
634
|
+
```
|
912
635
|
|
913
|
-
|
914
|
-
using namespaced models.
|
636
|
+
Fixes #31199.
|
915
637
|
|
916
|
-
*
|
638
|
+
*bogdanvlviv*
|
917
639
|
|
918
|
-
*
|
640
|
+
* Add support for PostgreSQL operator classes to `add_index`.
|
919
641
|
|
920
|
-
|
921
|
-
In 4.0 series it is delegated to `Array#join`.
|
922
|
-
|
923
|
-
*Bogdan Gusiev*
|
924
|
-
|
925
|
-
* Log nil binary column values correctly.
|
926
|
-
|
927
|
-
When an object with a binary column is updated with a nil value
|
928
|
-
in that column, the SQL logger would throw an exception when trying
|
929
|
-
to log that nil value. This only occurs when updating a record
|
930
|
-
that already has a non-nil value in that column since an initial nil
|
931
|
-
value isn't included in the SQL anyway (at least, when dirty checking
|
932
|
-
is enabled.) The column's new value will now be logged as `<NULL binary data>`
|
933
|
-
to parallel the existing `<N bytes of binary data>` for non-nil values.
|
934
|
-
|
935
|
-
*James Coleman*
|
936
|
-
|
937
|
-
* Rails will now pass a custom validation context through to autosave associations
|
938
|
-
in order to validate child associations with the same context.
|
939
|
-
|
940
|
-
Fixes #13854.
|
642
|
+
Example:
|
941
643
|
|
942
|
-
|
644
|
+
add_index :users, :name, using: :gist, opclass: { name: :gist_trgm_ops }
|
943
645
|
|
944
|
-
*
|
646
|
+
*Greg Navis*
|
945
647
|
|
946
|
-
|
947
|
-
was ignored and overwritten by strict mode option.
|
648
|
+
* Don't allow scopes to be defined which conflict with instance methods on `Relation`.
|
948
649
|
|
949
|
-
Fixes #
|
650
|
+
Fixes #31120.
|
950
651
|
|
951
|
-
*
|
652
|
+
*kinnrot*
|
952
653
|
|
953
|
-
*
|
654
|
+
* Add new error class `QueryCanceled` which will be raised
|
655
|
+
when canceling statement due to user request.
|
954
656
|
|
955
|
-
|
657
|
+
*Ryuta Kamizono*
|
956
658
|
|
957
|
-
|
659
|
+
* Add `#up_only` to database migrations for code that is only relevant when
|
660
|
+
migrating up, e.g. populating a new column.
|
958
661
|
|
959
|
-
*
|
662
|
+
*Rich Daley*
|
960
663
|
|
961
|
-
|
664
|
+
* Require raw SQL fragments to be explicitly marked when used in
|
665
|
+
relation query methods.
|
962
666
|
|
963
|
-
|
964
|
-
|
965
|
-
|
667
|
+
Before:
|
668
|
+
```
|
669
|
+
Article.order("LENGTH(title)")
|
670
|
+
```
|
966
671
|
|
967
|
-
|
672
|
+
After:
|
673
|
+
```
|
674
|
+
Article.order(Arel.sql("LENGTH(title)"))
|
675
|
+
```
|
968
676
|
|
969
|
-
|
677
|
+
This prevents SQL injection if applications use the [strongly
|
678
|
+
discouraged] form `Article.order(params[:my_order])`, under the
|
679
|
+
mistaken belief that only column names will be accepted.
|
970
680
|
|
971
|
-
|
972
|
-
|
681
|
+
Raw SQL strings will now cause a deprecation warning, which will
|
682
|
+
become an UnknownAttributeReference error in Rails 6.0. Applications
|
683
|
+
can opt in to the future behavior by setting `allow_unsafe_raw_sql`
|
684
|
+
to `:disabled`.
|
973
685
|
|
974
|
-
|
686
|
+
Common and judged-safe string values (such as simple column
|
687
|
+
references) are unaffected:
|
688
|
+
```
|
689
|
+
Article.order("title DESC")
|
690
|
+
```
|
975
691
|
|
976
|
-
*
|
977
|
-
different spellings of timestamps are treated the same.
|
692
|
+
*Ben Toews*
|
978
693
|
|
979
|
-
|
694
|
+
* `update_all` will now pass its values to `Type#cast` before passing them to
|
695
|
+
`Type#serialize`. This means that `update_all(foo: 'true')` will properly
|
696
|
+
persist a boolean.
|
980
697
|
|
981
|
-
|
982
|
-
# => :datetime
|
983
|
-
mytimestamp.simplified_type('timestamp(6) without time zone')
|
984
|
-
# => also :datetime (previously would be :timestamp)
|
698
|
+
*Sean Griffin*
|
985
699
|
|
986
|
-
|
700
|
+
* Add new error class `StatementTimeout` which will be raised
|
701
|
+
when statement timeout exceeded.
|
987
702
|
|
988
|
-
*
|
703
|
+
*Ryuta Kamizono*
|
989
704
|
|
990
|
-
* `
|
705
|
+
* Fix `bin/rails db:migrate` with specified `VERSION`.
|
706
|
+
`bin/rails db:migrate` with empty VERSION behaves as without `VERSION`.
|
707
|
+
Check a format of `VERSION`: Allow a migration version number
|
708
|
+
or name of a migration file. Raise error if format of `VERSION` is invalid.
|
709
|
+
Raise error if target migration doesn't exist.
|
991
710
|
|
992
|
-
|
711
|
+
*bogdanvlviv*
|
993
712
|
|
994
|
-
|
713
|
+
* Fixed a bug where column orders for an index weren't written to
|
714
|
+
`db/schema.rb` when using the sqlite adapter.
|
995
715
|
|
996
|
-
|
716
|
+
Fixes #30902.
|
997
717
|
|
998
|
-
|
718
|
+
*Paul Kuruvilla*
|
999
719
|
|
1000
|
-
|
720
|
+
* Remove deprecated method `#sanitize_conditions`.
|
1001
721
|
|
1002
|
-
*
|
1003
|
-
a scoped `has_many`.
|
722
|
+
*Rafael Mendonça França*
|
1004
723
|
|
1005
|
-
|
1006
|
-
`has_many :through` uses this association, then the scope adjustment is
|
1007
|
-
unexpectedly neglected.
|
724
|
+
* Remove deprecated method `#scope_chain`.
|
1008
725
|
|
1009
|
-
|
726
|
+
*Rafael Mendonça França*
|
1010
727
|
|
1011
|
-
|
728
|
+
* Remove deprecated configuration `.error_on_ignored_order_or_limit`.
|
1012
729
|
|
1013
|
-
*
|
730
|
+
*Rafael Mendonça França*
|
1014
731
|
|
1015
|
-
|
732
|
+
* Remove deprecated arguments from `#verify!`.
|
1016
733
|
|
1017
|
-
*
|
734
|
+
*Rafael Mendonça França*
|
1018
735
|
|
1019
|
-
|
736
|
+
* Remove deprecated argument `name` from `#indexes`.
|
1020
737
|
|
1021
|
-
*
|
738
|
+
*Rafael Mendonça França*
|
1022
739
|
|
1023
|
-
*
|
740
|
+
* Remove deprecated method `ActiveRecord::Migrator.schema_migrations_table_name`.
|
1024
741
|
|
1025
|
-
|
742
|
+
*Rafael Mendonça França*
|
1026
743
|
|
1027
|
-
|
744
|
+
* Remove deprecated method `supports_primary_key?`.
|
1028
745
|
|
1029
|
-
*
|
1030
|
-
LIKE statement.
|
746
|
+
*Rafael Mendonça França*
|
1031
747
|
|
1032
|
-
|
748
|
+
* Remove deprecated method `supports_migrations?`.
|
1033
749
|
|
1034
|
-
|
1035
|
-
def self.search(term)
|
1036
|
-
where("title LIKE ?", sanitize_sql_like(term))
|
1037
|
-
end
|
1038
|
-
end
|
750
|
+
*Rafael Mendonça França*
|
1039
751
|
|
1040
|
-
|
1041
|
-
# => Query looks like "... title LIKE '20\% \_reduction\_' ..."
|
752
|
+
* Remove deprecated methods `initialize_schema_migrations_table` and `initialize_internal_metadata_table`.
|
1042
753
|
|
1043
|
-
*
|
754
|
+
*Rafael Mendonça França*
|
1044
755
|
|
1045
|
-
*
|
756
|
+
* Raises when calling `lock!` in a dirty record.
|
1046
757
|
|
1047
|
-
|
758
|
+
*Rafael Mendonça França*
|
1048
759
|
|
1049
|
-
|
760
|
+
* Remove deprecated support to passing a class to `:class_name` on associations.
|
1050
761
|
|
1051
|
-
*
|
762
|
+
*Rafael Mendonça França*
|
1052
763
|
|
1053
|
-
|
764
|
+
* Remove deprecated argument `default` from `index_name_exists?`.
|
1054
765
|
|
1055
|
-
|
1056
|
-
# => true
|
1057
|
-
Post.where(author_id: author.id) == author.posts
|
1058
|
-
# => true
|
766
|
+
*Rafael Mendonça França*
|
1059
767
|
|
1060
|
-
|
768
|
+
* Remove deprecated support to `quoted_id` when typecasting an Active Record object.
|
1061
769
|
|
1062
|
-
*
|
770
|
+
*Rafael Mendonça França*
|
1063
771
|
|
1064
|
-
*
|
1065
|
-
|
772
|
+
* Fix `bin/rails db:setup` and `bin/rails db:test:prepare` create wrong
|
773
|
+
ar_internal_metadata's data for a test database.
|
1066
774
|
|
1067
775
|
Before:
|
1068
|
-
|
1069
|
-
|
1070
|
-
|
776
|
+
```
|
777
|
+
$ RAILS_ENV=test rails dbconsole
|
778
|
+
> SELECT * FROM ar_internal_metadata;
|
779
|
+
key|value|created_at|updated_at
|
780
|
+
environment|development|2017-09-11 23:14:10.815679|2017-09-11 23:14:10.815679
|
781
|
+
```
|
1071
782
|
|
1072
783
|
After:
|
784
|
+
```
|
785
|
+
$ RAILS_ENV=test rails dbconsole
|
786
|
+
> SELECT * FROM ar_internal_metadata;
|
787
|
+
key|value|created_at|updated_at
|
788
|
+
environment|test|2017-09-11 23:14:10.815679|2017-09-11 23:14:10.815679
|
789
|
+
```
|
1073
790
|
|
1074
|
-
|
791
|
+
Fixes #26731.
|
1075
792
|
|
1076
|
-
*
|
793
|
+
*bogdanvlviv*
|
1077
794
|
|
1078
|
-
* Fix
|
1079
|
-
with `select`.
|
795
|
+
* Fix longer sequence name detection for serial columns.
|
1080
796
|
|
1081
|
-
Fixes #
|
797
|
+
Fixes #28332.
|
1082
798
|
|
1083
|
-
*
|
799
|
+
*Ryuta Kamizono*
|
1084
800
|
|
1085
|
-
*
|
801
|
+
* MySQL: Don't lose `auto_increment: true` in the `db/schema.rb`.
|
1086
802
|
|
1087
|
-
Fixes #
|
803
|
+
Fixes #30894.
|
1088
804
|
|
1089
|
-
*
|
805
|
+
*Ryuta Kamizono*
|
1090
806
|
|
1091
|
-
*
|
1092
|
-
unknown OIDs.
|
807
|
+
* Fix `COUNT(DISTINCT ...)` for `GROUP BY` with `ORDER BY` and `LIMIT`.
|
1093
808
|
|
1094
|
-
Fixes #
|
809
|
+
Fixes #30886.
|
1095
810
|
|
1096
|
-
*
|
811
|
+
*Ryuta Kamizono*
|
1097
812
|
|
1098
|
-
*
|
813
|
+
* PostgreSQL `tsrange` now preserves subsecond precision.
|
1099
814
|
|
1100
|
-
|
815
|
+
PostgreSQL 9.1+ introduced range types, and Rails added support for using
|
816
|
+
this datatype in Active Record. However, the serialization of
|
817
|
+
`PostgreSQL::OID::Range` was incomplete, because it did not properly
|
818
|
+
cast the bounds that make up the range. This led to subseconds being
|
819
|
+
dropped in SQL commands:
|
1101
820
|
|
1102
|
-
|
821
|
+
Before:
|
1103
822
|
|
1104
|
-
|
823
|
+
connection.type_cast(tsrange.serialize(range_value))
|
824
|
+
# => "[2010-01-01 13:30:00 UTC,2011-02-02 19:30:00 UTC)"
|
1105
825
|
|
1106
|
-
|
826
|
+
Now:
|
1107
827
|
|
1108
|
-
|
828
|
+
connection.type_cast(tsrange.serialize(range_value))
|
829
|
+
# => "[2010-01-01 13:30:00.670277,2011-02-02 19:30:00.745125)"
|
1109
830
|
|
1110
|
-
*
|
1111
|
-
same name in an unrelated class.
|
831
|
+
*Thomas Cannon*
|
1112
832
|
|
1113
|
-
|
833
|
+
* Passing a `Set` to `Relation#where` now behaves the same as passing an
|
834
|
+
array.
|
1114
835
|
|
1115
|
-
*
|
836
|
+
*Sean Griffin*
|
1116
837
|
|
1117
|
-
*
|
838
|
+
* Use given algorithm while removing index from database.
|
1118
839
|
|
1119
|
-
Fixes #
|
840
|
+
Fixes #24190.
|
1120
841
|
|
1121
|
-
*
|
842
|
+
*Mehmet Emin İNAÇ*
|
1122
843
|
|
1123
|
-
*
|
844
|
+
* Update payload names for `sql.active_record` instrumentation to be
|
845
|
+
more descriptive.
|
1124
846
|
|
1125
|
-
Fixes #
|
847
|
+
Fixes #30586.
|
1126
848
|
|
1127
|
-
*
|
849
|
+
*Jeremy Green*
|
1128
850
|
|
1129
|
-
*
|
1130
|
-
|
1131
|
-
a previous query). `CollectionProxy` now always defers to the association scope's
|
1132
|
-
`arel` method so the (incorrect) inherited one should be entirely concealed.
|
851
|
+
* Add new error class `LockWaitTimeout` which will be raised
|
852
|
+
when lock wait timeout exceeded.
|
1133
853
|
|
1134
|
-
|
854
|
+
*Gabriel Courtemanche*
|
1135
855
|
|
1136
|
-
|
856
|
+
* Remove deprecated `#migration_keys`.
|
1137
857
|
|
1138
|
-
*
|
858
|
+
*Ryuta Kamizono*
|
1139
859
|
|
1140
|
-
|
860
|
+
* Automatically guess the inverse associations for STI.
|
1141
861
|
|
1142
|
-
|
862
|
+
*Yuichiro Kaneko*
|
1143
863
|
|
1144
|
-
|
864
|
+
* Ensure `sum` honors `distinct` on `has_many :through` associations.
|
1145
865
|
|
1146
|
-
|
866
|
+
Fixes #16791.
|
1147
867
|
|
1148
|
-
|
868
|
+
*Aaron Wortham*
|
1149
869
|
|
1150
|
-
|
870
|
+
* Add `binary` fixture helper method.
|
1151
871
|
|
1152
|
-
*
|
1153
|
-
deprecated in 4.1) from relative to absolute.
|
872
|
+
*Atsushi Yoshida*
|
1154
873
|
|
1155
|
-
|
1156
|
-
`sqlite3:///my/path` with `sqlite3:my/path`.
|
874
|
+
* When using `Relation#or`, extract the common conditions and put them before the OR condition.
|
1157
875
|
|
1158
|
-
*
|
876
|
+
*Maxime Handfield Lapointe*
|
1159
877
|
|
1160
|
-
*
|
878
|
+
* `Relation#or` now accepts two relations who have different values for
|
879
|
+
`references` only, as `references` can be implicitly called by `where`.
|
1161
880
|
|
1162
|
-
|
881
|
+
Fixes #29411.
|
1163
882
|
|
1164
|
-
|
883
|
+
*Sean Griffin*
|
1165
884
|
|
1166
|
-
|
885
|
+
* `ApplicationRecord` is no longer generated when generating models. If you
|
886
|
+
need to generate it, it can be created with `rails g application_record`.
|
1167
887
|
|
1168
|
-
*
|
888
|
+
*Lisa Ugray*
|
1169
889
|
|
1170
|
-
|
890
|
+
* Fix `COUNT(DISTINCT ...)` with `ORDER BY` and `LIMIT` to keep the existing select list.
|
1171
891
|
|
1172
|
-
*
|
892
|
+
*Ryuta Kamizono*
|
1173
893
|
|
1174
|
-
|
894
|
+
* When a `has_one` association is destroyed by `dependent: destroy`,
|
895
|
+
`destroyed_by_association` will now be set to the reflection, matching the
|
896
|
+
behaviour of `has_many` associations.
|
1175
897
|
|
1176
|
-
*
|
1177
|
-
The column types stay the same except for enum columns. They no longer have
|
1178
|
-
`nil` as type but `enum`.
|
898
|
+
*Lisa Ugray*
|
1179
899
|
|
1180
|
-
|
900
|
+
* Fix `unscoped(where: [columns])` removing the wrong bind values.
|
1181
901
|
|
1182
|
-
|
902
|
+
When the `where` is called on a relation after a `or`, unscoping the column of that later `where` removed
|
903
|
+
bind values used by the `or` instead. (possibly other cases too)
|
1183
904
|
|
1184
|
-
|
1185
|
-
|
905
|
+
```
|
906
|
+
Post.where(id: 1).or(Post.where(id: 2)).where(foo: 3).unscope(where: :foo).to_sql
|
907
|
+
# Currently:
|
908
|
+
# SELECT "posts".* FROM "posts" WHERE ("posts"."id" = 2 OR "posts"."id" = 3)
|
909
|
+
# With fix:
|
910
|
+
# SELECT "posts".* FROM "posts" WHERE ("posts"."id" = 1 OR "posts"."id" = 2)
|
911
|
+
```
|
1186
912
|
|
1187
|
-
|
913
|
+
*Maxime Handfield Lapointe*
|
1188
914
|
|
1189
|
-
|
915
|
+
* Values constructed using multi-parameter assignment will now use the
|
916
|
+
post-type-cast value for rendering in single-field form inputs.
|
1190
917
|
|
1191
|
-
*
|
1192
|
-
custom primary key that did not save due to validation error.
|
918
|
+
*Sean Griffin*
|
1193
919
|
|
1194
|
-
|
920
|
+
* `Relation#joins` is no longer affected by the target model's
|
921
|
+
`current_scope`, with the exception of `unscoped`.
|
1195
922
|
|
1196
|
-
|
923
|
+
Fixes #29338.
|
1197
924
|
|
1198
|
-
*
|
925
|
+
*Sean Griffin*
|
1199
926
|
|
1200
|
-
|
927
|
+
* Change sqlite3 boolean serialization to use 1 and 0.
|
1201
928
|
|
1202
|
-
|
929
|
+
SQLite natively recognizes 1 and 0 as true and false, but does not natively
|
930
|
+
recognize 't' and 'f' as was previously serialized.
|
1203
931
|
|
1204
|
-
|
932
|
+
This change in serialization requires a migration of stored boolean data
|
933
|
+
for SQLite databases, so it's implemented behind a configuration flag
|
934
|
+
whose default false value is deprecated.
|
1205
935
|
|
1206
|
-
|
1207
|
-
would commit the transaction.
|
936
|
+
*Lisa Ugray*
|
1208
937
|
|
1209
|
-
|
1210
|
-
|
938
|
+
* Skip query caching when working with batches of records (`find_each`, `find_in_batches`,
|
939
|
+
`in_batches`).
|
1211
940
|
|
1212
|
-
|
941
|
+
Previously, records would be fetched in batches, but all records would be retained in memory
|
942
|
+
until the end of the request or job.
|
1213
943
|
|
1214
|
-
|
1215
|
-
t.index :zip
|
1216
|
-
end
|
1217
|
-
# => CREATE TEMPORARY TABLE temp (INDEX (zip)) AS SELECT id, name, zip FROM a_really_complicated_query
|
944
|
+
*Eugene Kenny*
|
1218
945
|
|
1219
|
-
|
946
|
+
* Prevent errors raised by `sql.active_record` notification subscribers from being converted into
|
947
|
+
`ActiveRecord::StatementInvalid` exceptions.
|
1220
948
|
|
1221
|
-
*
|
1222
|
-
`ActiveRecord::Base.pluralize_table_names` is `false`.
|
949
|
+
*Dennis Taylor*
|
1223
950
|
|
1224
|
-
|
951
|
+
* Fix eager loading/preloading association with scope including joins.
|
1225
952
|
|
1226
|
-
|
953
|
+
Fixes #28324.
|
1227
954
|
|
1228
|
-
*
|
955
|
+
*Ryuta Kamizono*
|
1229
956
|
|
1230
|
-
|
957
|
+
* Fix transactions to apply state to child transactions.
|
1231
958
|
|
1232
|
-
|
1233
|
-
|
959
|
+
Previously, if you had a nested transaction and the outer transaction was rolledback, the record from the
|
960
|
+
inner transaction would still be marked as persisted.
|
1234
961
|
|
1235
|
-
|
962
|
+
This change fixes that by applying the state of the parent transaction to the child transaction when the
|
963
|
+
parent transaction is rolledback. This will correctly mark records from the inner transaction as not persisted.
|
1236
964
|
|
1237
|
-
*
|
1238
|
-
migration table exists.
|
965
|
+
*Eileen M. Uchitelle*, *Aaron Patterson*
|
1239
966
|
|
1240
|
-
|
967
|
+
* Deprecate `set_state` method in `TransactionState`.
|
1241
968
|
|
1242
|
-
|
969
|
+
Deprecated the `set_state` method in favor of setting the state via specific methods. If you need to mark the
|
970
|
+
state of the transaction you can now use `rollback!`, `commit!` or `nullify!` instead of
|
971
|
+
`set_state(:rolledback)`, `set_state(:committed)`, or `set_state(nil)`.
|
1243
972
|
|
1244
|
-
*
|
1245
|
-
of waiting until they disconnect by themselves. Before this change,
|
1246
|
-
a suitably constructed series of short-lived threads could starve
|
1247
|
-
the connection pool, without ever having more than a couple alive at
|
1248
|
-
the same time.
|
973
|
+
*Eileen M. Uchitelle*, *Aaron Patterson*
|
1249
974
|
|
1250
|
-
|
975
|
+
* Deprecate delegating to `arel` in `Relation`.
|
1251
976
|
|
1252
|
-
*
|
1253
|
-
pointing to pg_class, and thus only sequence objects, are considered.
|
977
|
+
*Ryuta Kamizono*
|
1254
978
|
|
1255
|
-
|
979
|
+
* Query cache was unavailable when entering the `ActiveRecord::Base.cache` block
|
980
|
+
without being connected.
|
1256
981
|
|
1257
|
-
*
|
982
|
+
*Tsukasa Oishi*
|
1258
983
|
|
1259
|
-
|
984
|
+
* Previously, when building records using a `has_many :through` association,
|
985
|
+
if the child records were deleted before the parent was saved, they would
|
986
|
+
still be persisted. Now, if child records are deleted before the parent is saved
|
987
|
+
on a `has_many :through` association, the child records will not be persisted.
|
1260
988
|
|
1261
|
-
*
|
989
|
+
*Tobias Kraze*
|
1262
990
|
|
1263
|
-
*
|
991
|
+
* Merging two relations representing nested joins no longer transforms the joins of
|
992
|
+
the merged relation into LEFT OUTER JOIN.
|
1264
993
|
|
1265
994
|
Example:
|
1266
995
|
|
1267
|
-
|
1268
|
-
|
1269
|
-
|
1270
|
-
|
996
|
+
```
|
997
|
+
Author.joins(:posts).merge(Post.joins(:comments))
|
998
|
+
# Before the change:
|
999
|
+
#=> SELECT ... FROM authors INNER JOIN posts ON ... LEFT OUTER JOIN comments ON...
|
1271
1000
|
|
1272
|
-
|
1001
|
+
# After the change:
|
1002
|
+
#=> SELECT ... FROM authors INNER JOIN posts ON ... INNER JOIN comments ON...
|
1003
|
+
```
|
1273
1004
|
|
1274
|
-
*
|
1005
|
+
*Maxime Handfield Lapointe*
|
1275
1006
|
|
1276
|
-
|
1007
|
+
* `ActiveRecord::Persistence#touch` does not work well when optimistic locking enabled and
|
1008
|
+
`locking_column`, without default value, is null in the database.
|
1277
1009
|
|
1278
|
-
*
|
1010
|
+
*bogdanvlviv*
|
1279
1011
|
|
1280
|
-
*
|
1281
|
-
|
1012
|
+
* Fix destroying existing object does not work well when optimistic locking enabled and
|
1013
|
+
`locking_column` is null in the database.
|
1282
1014
|
|
1283
|
-
*
|
1284
|
-
|
1285
|
-
* Only use BINARY for MySQL case sensitive uniqueness check when column
|
1286
|
-
has a case insensitive collation.
|
1287
|
-
|
1288
|
-
*Ryuta Kamizono*
|
1015
|
+
*bogdanvlviv*
|
1289
1016
|
|
1290
|
-
*
|
1017
|
+
* Use bulk INSERT to insert fixtures for better performance.
|
1291
1018
|
|
1292
|
-
*
|
1019
|
+
*Kir Shatrov*
|
1293
1020
|
|
1294
|
-
*
|
1295
|
-
`where` values without needing to wrap in UPPER/LOWER sql functions.
|
1021
|
+
* Prevent creation of bind param if casted value is nil.
|
1296
1022
|
|
1297
|
-
*
|
1298
|
-
|
1299
|
-
* Only save has_one associations if record has changes.
|
1300
|
-
Previously after save related callbacks, such as `#after_commit`, were triggered when the has_one
|
1301
|
-
object did not get saved to the db.
|
1023
|
+
*Ryuta Kamizono*
|
1302
1024
|
|
1303
|
-
|
1025
|
+
* Deprecate passing arguments and block at the same time to `count` and `sum` in `ActiveRecord::Calculations`.
|
1304
1026
|
|
1305
|
-
*
|
1027
|
+
*Ryuta Kamizono*
|
1306
1028
|
|
1307
|
-
|
1029
|
+
* Loading model schema from database is now thread-safe.
|
1308
1030
|
|
1309
|
-
|
1031
|
+
Fixes #28589.
|
1310
1032
|
|
1311
|
-
*
|
1033
|
+
*Vikrant Chaudhary*, *David Abdemoulaie*
|
1312
1034
|
|
1313
|
-
*
|
1314
|
-
|
1035
|
+
* Add `ActiveRecord::Base#cache_version` to support recyclable cache keys via the new versioned entries
|
1036
|
+
in `ActiveSupport::Cache`. This also means that `ActiveRecord::Base#cache_key` will now return a stable key
|
1037
|
+
that does not include a timestamp any more.
|
1315
1038
|
|
1316
|
-
|
1039
|
+
NOTE: This feature is turned off by default, and `#cache_key` will still return cache keys with timestamps
|
1040
|
+
until you set `ActiveRecord::Base.cache_versioning = true`. That's the setting for all new apps on Rails 5.2+
|
1317
1041
|
|
1318
|
-
*
|
1319
|
-
joins are involved.
|
1042
|
+
*DHH*
|
1320
1043
|
|
1321
|
-
|
1044
|
+
* Respect `SchemaDumper.ignore_tables` in rake tasks for databases structure dump.
|
1322
1045
|
|
1323
|
-
*
|
1046
|
+
*Rusty Geldmacher*, *Guillermo Iguaran*
|
1324
1047
|
|
1325
|
-
*
|
1326
|
-
any enum attribute is always evaluated as 0 during uniqueness validation.
|
1048
|
+
* Add type caster to `RuntimeReflection#alias_name`.
|
1327
1049
|
|
1328
|
-
Fixes #
|
1050
|
+
Fixes #28959.
|
1329
1051
|
|
1330
|
-
*
|
1052
|
+
*Jon Moss*
|
1331
1053
|
|
1332
|
-
* `
|
1333
|
-
`has_and_belongs_to_many` associations *and* on `has_many :through`
|
1334
|
-
associations. Before this change, `before_add` callbacks would be fired
|
1335
|
-
before the record was saved on `has_and_belongs_to_many` associations, but
|
1336
|
-
*not* on `has_many :through` associations.
|
1054
|
+
* Deprecate `supports_statement_cache?`.
|
1337
1055
|
|
1338
|
-
|
1056
|
+
*Ryuta Kamizono*
|
1339
1057
|
|
1340
|
-
*
|
1341
|
-
|
1058
|
+
* Raise error `UnknownMigrationVersionError` on the movement of migrations
|
1059
|
+
when the current migration does not exist.
|
1342
1060
|
|
1343
|
-
|
1061
|
+
*bogdanvlviv*
|
1344
1062
|
|
1345
|
-
|
1063
|
+
* Fix `bin/rails db:forward` first migration.
|
1346
1064
|
|
1347
|
-
*
|
1065
|
+
*bogdanvlviv*
|
1348
1066
|
|
1349
|
-
|
1067
|
+
* Support Descending Indexes for MySQL.
|
1350
1068
|
|
1351
|
-
|
1352
|
-
|
1353
|
-
book.title # => "12345"
|
1069
|
+
MySQL 8.0.1 and higher supports descending indexes: `DESC` in an index definition is no longer ignored.
|
1070
|
+
See https://dev.mysql.com/doc/refman/8.0/en/descending-indexes.html.
|
1354
1071
|
|
1355
|
-
*
|
1072
|
+
*Ryuta Kamizono*
|
1356
1073
|
|
1357
|
-
*
|
1358
|
-
We currently map PostgreSQL ranges to Ruby ranges. This conversion is not fully
|
1359
|
-
possible because the Ruby range does not support excluded beginnings.
|
1074
|
+
* Fix inconsistency with changed attributes when overriding Active Record attribute reader.
|
1360
1075
|
|
1361
|
-
|
1362
|
-
deprecated. For subtypes where we don't know how to increment (e.g. `#succ`
|
1363
|
-
is not defined) it will raise an `ArgumentException` for ranges with excluding
|
1364
|
-
beginnings.
|
1076
|
+
*bogdanvlviv*
|
1365
1077
|
|
1366
|
-
|
1078
|
+
* When calling the dynamic fixture accessor method with no arguments, it now returns all fixtures of this type.
|
1079
|
+
Previously this method always returned an empty array.
|
1367
1080
|
|
1368
|
-
*
|
1081
|
+
*Kevin McPhillips*
|
1369
1082
|
|
1370
|
-
*Yves Senn*
|
1371
1083
|
|
1372
|
-
Please check [
|
1084
|
+
Please check [5-1-stable](https://github.com/rails/rails/blob/5-1-stable/activerecord/CHANGELOG.md) for previous changes.
|