diff options
Diffstat (limited to 'activerecord/CHANGELOG.md')
-rw-r--r-- | activerecord/CHANGELOG.md | 436 |
1 files changed, 420 insertions, 16 deletions
diff --git a/activerecord/CHANGELOG.md b/activerecord/CHANGELOG.md index 74f5666de0..39c8769814 100644 --- a/activerecord/CHANGELOG.md +++ b/activerecord/CHANGELOG.md @@ -1,3 +1,412 @@ +* Deprecate `serialized_attributes` without replacement. You can access its + behavior by going through the column's type object. + + *Sean Griffin* + +* Correctly extract IPv6 addresses from `DATABASE_URI`: the square brackets + are part of the URI structure, not the actual host. + + Fixes #15705. + + *Andy Bakun*, *Aaron Stone* + +* Ensure both parent IDs are set on join records when both sides of a + through association are new. + + *Sean Griffin* + +* `ActiveRecord::Dirty` now detects in-place changes to mutable values. + Serialized attributes on ActiveRecord models will no longer save when + unchanged. Fixes #8328. + + Sean Griffin + +* Fixed automatic maintaining test schema to properly handle sql structure + schema format. + + Fixes #15394. + + *Wojciech Wnętrzak* + +* Pluck now works when selecting columns from different tables with the same + name. + + Fixes #15649 + + *Sean Griffin* + +* Remove `cache_attributes` and friends. All attributes are cached. + + *Sean Griffin* + +* Remove deprecated method `ActiveRecord::Base.quoted_locking_column`. + + *Akshay Vishnoi* + +* `ActiveRecord::FinderMethods.find` with block can handle proc parameter as + `Enumerable#find` does. + + Fixes #15382. + + *James Yang* + +* Make timezone aware attributes work with PostgreSQL array columns. + + Fixes #13402. + + *Kuldeep Aggarwal*, *Sean Griffin* + +* `ActiveRecord::SchemaMigration` has no primary key regardless of the + `primary_key_prefix_type` configuration. + + Fixes #15051. + + *JoseLuis Torres*, *Yves Senn* + +* `rake db:migrate:status` works with legacy migration numbers like `00018_xyz.rb`. + + Fixes #15538. + + *Yves Senn* + +* Baseclass becomes! subclass. + + Before this change, a record which changed its STI type, could not be + updated. + + Fixes #14785. + + *Matthew Draper*, *Earl St Sauver*, *Edo Balvers* + +* Remove deprecated `ActiveRecord::Migrator.proper_table_name`. Use the + `proper_table_name` instance method on `ActiveRecord::Migration` instead. + + *Akshay Vishnoi* + +* Fix regression on eager loading association based on SQL query rather than + existing column. + + Fixes #15480. + + *Lauro Caetano*, *Carlos Antonio da Silva* + +* Return a null column from `column_for_attribute` when no column exists. + + *Sean Griffin* + +* Implemented ActiveRecord::Base#pretty_print to work with PP. + + *Ethan* + +* Preserve type when dumping PostgreSQL point, bit, bit varying and money + columns. + + *Yves Senn* + +* New records remain new after YAML serialization. + + *Sean Griffin* + +* PostgreSQL support default values for enum types. Fixes #7814. + + *Yves Senn* + +* PostgreSQL `default_sequence_name` respects schema. Fixes #7516. + + *Yves Senn* + +* Fixed `columns_for_distinct` of postgresql adapter to work correctly + with orders without sort direction modifiers. + + *Nikolay Kondratyev* + +* PostgreSQL `reset_pk_sequence!` respects schemas. Fixes #14719. + + *Yves Senn* + +* Keep PostgreSQL `hstore` and `json` attributes as `Hash` in `@attributes`. + Fixes duplication in combination with `store_accessor`. + + Fixes #15369. + + *Yves Senn* + +* `rake railties:install:migrations` respects the order of railties. + + *Arun Agrawal* + +* Fix redefine a has_and_belongs_to_many inside inherited class + Fixing regression case, where redefining the same has_an_belongs_to_many + definition into a subclass would raise. + + Fixes #14983. + + *arthurnn* + +* Fix has_and_belongs_to_many public reflection. + When defining a has_and_belongs_to_many, internally we convert that to two has_many. + But as `reflections` is a public API, people expect to see the right macro. + + Fixes #14682. + + *arthurnn* + +* Fixed serialization for records with an attribute named `format`. + + Fixes #15188. + + *Godfrey Chan* + +* When a `group` is set, `sum`, `size`, `average`, `minimum` and `maximum` + on a NullRelation should return a Hash. + + *Kuldeep Aggarwal* + +* Fixed serialized fields returning serialized data after being updated with + `update_column`. + + *Simon Hørup Eskildsen* + +* Fixed polymorphic eager loading when using a String as foreign key. + + Fixes #14734. + + *Lauro Caetano* + +* Change belongs_to touch to be consistent with timestamp updates + + If a model is set up with a belongs_to: touch relationship the parent + record will only be touched if the record was modified. This makes it + consistent with timestamp updating on the record itself. + + *Brock Trappitt* + +* Fixed the inferred table name of a has_and_belongs_to_many auxiliar + table inside a schema. + + Fixes #14824 + + *Eric Chahin* + +* Remove unused `:timestamp` type. Transparently alias it to `:datetime` + in all cases. Fixes inconsistencies when column types are sent outside of + `ActiveRecord`, such as for XML Serialization. + + *Sean Griffin* + +* Fix bug that added `table_name_prefix` and `table_name_suffix` to + extension names in PostgreSQL when migrating. + + *Joao Carlos* + +* The `:index` option in migrations, which previously was only available for + `references`, now works with any column types. + + *Marc Schütz* + +* Add support for counter name to be passed as parameter on `CounterCache::ClassMethods#reset_counters`. + + *jnormore* + +* Restrict deletion of record when using `delete_all` with `uniq`, `group`, `having` + or `offset`. + + In these cases the generated query ignored them and that caused unintended + records to be deleted. + + Fixes #11985. + + *Leandro Facchinetti* + +* Floats with limit >= 25 that get turned into doubles in MySQL no longer have + their limit dropped from the schema. + + Fixes #14135. + + *Aaron Nelson* + +* Fix how to calculate associated class name when using namespaced has_and_belongs_to_many + association. + + Fixes #14709. + + *Kassio Borges* + +* `ActiveRecord::Relation::Merger#filter_binds` now compares equivalent symbols and + strings in column names as equal. + + This fixes a rare case in which more bind values are passed than there are + placeholders for them in the generated SQL statement, which can make PostgreSQL + throw a `StatementInvalid` exception. + + *Nat Budin* + +* Fix `stored_attributes` to correctly merge the details of stored + attributes defined in parent classes. + + Fixes #14672. + + *Brad Bennett*, *Jessica Yao*, *Lakshmi Parthasarathy* + +* `change_column_default` allows `[]` as argument to `change_column_default`. + + Fixes #11586. + + *Yves Senn* + +* Handle `name` and `"char"` column types in the PostgreSQL adapter. + + `name` and `"char"` are special character types used internally by + PostgreSQL and are used by internal system catalogs. These field types + can sometimes show up in structure-sniffing queries that feature internal system + structures or with certain PostgreSQL extensions. + + *J Smith*, *Yves Senn* + +* Fix `PostgreSQLAdapter::OID::Float#type_cast` to convert Infinity and + NaN PostgreSQL values into a native Ruby `Float::INFINITY` and `Float::NAN` + + Before: + + Point.create(value: 1.0/0) + Point.last.value # => 0.0 + + After: + + Point.create(value: 1.0/0) + Point.last.value # => Infinity + + *Innokenty Mikhailov* + +* Allow the PostgreSQL adapter to handle bigserial primary key types again. + + Fixes #10410. + + *Patrick Robertson* + +* Deprecate joining, eager loading and preloading of instance dependent + associations without replacement. These operations happen before instances + are created. The current behavior is unexpected and can result in broken + behavior. + + Fixes #15024. + + *Yves Senn* + +* Fixed has_and_belongs_to_many's CollectionAssociation size calculation. + + has_and_belongs_to_many should fall back to using the normal CollectionAssociation's + size calculation if the collection is not cached or loaded. + + Fixes #14913, #14914. + + *Fred Wu* + +* Return a non zero status when running `rake db:migrate:status` and migration table does + not exist. + + *Paul B.* + +* Add support for module-level `table_name_suffix` in models. + + This makes `table_name_suffix` work the same way as `table_name_prefix` when + using namespaced models. + + *Jenner LaFave* + +* Revert the behaviour of `ActiveRecord::Relation#join` changed through 4.0 => 4.1 to 4.0. + + In 4.1.0 `Relation#join` is delegated to `Arel#SelectManager`. + In 4.0 series it is delegated to `Array#join`. + + *Bogdan Gusiev* + +* Log nil binary column values correctly. + + When an object with a binary column is updated with a nil value + in that column, the SQL logger would throw an exception when trying + to log that nil value. This only occurs when updating a record + that already has a non-nil value in that column since an initial nil + value isn't included in the SQL anyway (at least, when dirty checking + is enabled.) The column's new value will now be logged as `<NULL binary data>` + to parallel the existing `<N bytes of binary data>` for non-nil values. + + *James Coleman* + +* Rails will now pass a custom validation context through to autosave associations + in order to validate child associations with the same context. + + Fixes #13854. + + *Eric Chahin*, *Aaron Nelson*, *Kevin Casey* + +* Stringify all variables keys of MySQL connection configuration. + + When `sql_mode` variable for MySQL adapters set in configuration as `String` + was ignored and overwritten by strict mode option. + + Fixes #14895. + + *Paul Nikitochkin* + +* Ensure SQLite3 statements are closed on errors. + + Fixes #13631. + + *Timur Alperovich* + +* Give ActiveRecord::PredicateBuilder private methods the privacy they deserve. + + *Hector Satre* + +* When using a custom `join_table` name on a `habtm`, rails was not saving it + on Reflections. This causes a problem when rails loads fixtures, because it + uses the reflections to set database with fixtures. + + Fixes #14845. + + *Kassio Borges* + +* Reset the cache when modifying a Relation with cached Arel. + Additionally display a warning message to make the user aware. + + *Yves Senn* + +* PostgreSQL should internally use `:datetime` consistently for TimeStamp. Assures + different spellings of timestamps are treated the same. + + Example: + + mytimestamp.simplified_type('timestamp without time zone') + # => :datetime + mytimestamp.simplified_type('timestamp(6) without time zone') + # => also :datetime (previously would be :timestamp) + + See #14513. + + *Jefferson Lai* + +* `ActiveRecord::Base.no_touching` no longer triggers callbacks or start empty transactions. + + Fixes #14841. + + *Lucas Mazza* + +* Fix name collision with `Array#select!` with `Relation#select!`. + + Fixes #14752. + + *Earl St Sauver* + +* Fixed unexpected behavior for `has_many :through` associations going through a scoped `has_many`. + + If a `has_many` association is adjusted using a scope, and another `has_many :through` + uses this association, then the scope adjustment is unexpectedly neglected. + + Fixes #14537. + + *Jan Habermann* + * `@destroyed` should always be set to `false` when an object is duped. *Kuldeep Aggarwal* @@ -14,7 +423,7 @@ *Eric Chahin* -* `sanitize_sql_like` helper method to escape a string for safe use in a SQL +* `sanitize_sql_like` helper method to escape a string for safe use in an SQL LIKE statement. Example: @@ -50,7 +459,7 @@ *Lauro Caetano* * Calling `delete_all` on an unloaded `CollectionProxy` no longer - generates a SQL statement containing each id of the collection: + generates an SQL statement containing each id of the collection: Before: @@ -91,7 +500,7 @@ * Auto-generate stable fixture UUIDs on PostgreSQL. - Fixes: #11524 + Fixes #11524. *Roderick van Domburg* @@ -175,10 +584,6 @@ *Luke Steensen* -* Make possible to change `record_timestamps` inside Callbacks. - - *Tieg Zaharia* - * Fixed error where .persisted? throws SystemStackError for an unsaved model with a custom primary key that didn't save due to validation error. @@ -209,12 +614,6 @@ *Cody Cutrer*, *Steve Rice*, *Rafael Mendonça Franca* -* Save `has_one` association even if the record doesn't changed. - - Fixes #14407. - - *Rafael Mendonça França* - * Use singular table name in generated migrations when `ActiveRecord::Base.pluralize_table_names` is `false`. @@ -274,12 +673,11 @@ *arthurnn* -* Passing an Active Record object to `find` is now deprecated. Call `.id` - on the object first. - * Passing an Active Record object to `find` or `exists?` is now deprecated. Call `.id` on the object first. + *Aaron Patterson* + * Only use BINARY for MySQL case sensitive uniqueness check when column has a case insensitive collation. *Ryuta Kamizono* @@ -293,6 +691,12 @@ *Troy Kruthoff*, *Lachlan Sylvester* +* Only save has_one associations if record has changes. + Previously after save related callbacks, such as `#after_commit`, were triggered when the has_one + object did not get saved to the db. + + *Alan Kennedy* + * Allow strings to specify the `#order` value. Example: |