aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/CHANGELOG.md
diff options
context:
space:
mode:
Diffstat (limited to 'activerecord/CHANGELOG.md')
-rw-r--r--activerecord/CHANGELOG.md78
1 files changed, 71 insertions, 7 deletions
diff --git a/activerecord/CHANGELOG.md b/activerecord/CHANGELOG.md
index 0497f6326e..b549f594bb 100644
--- a/activerecord/CHANGELOG.md
+++ b/activerecord/CHANGELOG.md
@@ -1,8 +1,71 @@
+* Exit with non-zero status for failed database rake tasks.
+
+ *Jay Hayes*
+
+* Added `ActiveRecord::Base.to_param` for convenient "pretty" URLs derived from a model's attribute or method.
+
+ Example:
+
+ class User < ActiveRecord::Base
+ to_param :name
+ end
+
+ user = User.find_by(name: 'Fancy Pants')
+ user.id # => 123
+ user.to_param # => "123-fancy-pants"
+
+ *Javan Makhmali*
+
+* Added `ActiveRecord::Base.no_touching`, which allows ignoring touch on models.
+
+ Example:
+
+ Post.no_touching do
+ Post.first.touch
+ end
+
+ *Sam Stephenson*, *Damien Mathieu*
+
+* Prevent the counter cache from being decremented twice when destroying
+ a record on a `has_many :through` association.
+
+ Fixes #11079.
+
+ *Dmitry Dedov*
+
+* Unify boolean type casting for `MysqlAdapter` and `Mysql2Adapter`.
+ `type_cast` will return `1` for `true` and `0` for `false`.
+
+ Fixes #11119.
+
+ *Adam Williams*, *Yves Senn*
+
+* Fix bug where `has_one` associaton record update result in crash, when replaced with itself.
+
+ Fixes #12834.
+
+ *Denis Redozubov*, *Sergio Cambra*
+
+* Log bind variables after they are type casted. This makes it more
+ transparent what values are actually sent to the database.
+
+ irb(main):002:0> Event.find("im-no-integer")
+ # Before: ... WHERE "events"."id" = $1 LIMIT 1 [["id", "im-no-integer"]]
+ # After: ... WHERE "events"."id" = $1 LIMIT 1 [["id", 0]]
+
+ *Yves Senn*
+
+* Fix uninitialized constant `TransactionState` error when `Marshall.load` is used on an Active Record result.
+
+ Fixes #12790.
+
+ *Jason Ayre*
+
* `.unscope` now removes conditions specified in `default_scope`.
*Jon Leighton*
-* Added ActiveRecord::QueryMethods#rewhere which will overwrite an existing, named where condition.
+* Added `ActiveRecord::QueryMethods#rewhere` which will overwrite an existing, named where condition.
Examples:
@@ -12,7 +75,7 @@
*DHH*
-* Extend ActiveRecord::Base#cache_key to take an optional list of timestamp attributes of which the highest will be used.
+* Extend `ActiveRecord::Base#cache_key` to take an optional list of timestamp attributes of which the highest will be used.
Example:
@@ -21,7 +84,7 @@
*DHH*
-* Added ActiveRecord::Base#enum for declaring enum attributes where the values map to integers in the database, but can be queried by name.
+* Added `ActiveRecord::Base#enum` for declaring enum attributes where the values map to integers in the database, but can be queried by name.
Example:
@@ -34,23 +97,23 @@
# conversation.update! status: 0
conversation.active!
conversation.active? # => true
- conversation.status # => :active
+ conversation.status # => "active"
# conversation.update! status: 1
conversation.archived!
conversation.archived? # => true
- conversation.status # => :archived
+ conversation.status # => "archived"
# conversation.update! status: 1
conversation.status = :archived
*DHH*
-* ActiveRecord::Base#attribute_for_inspect now truncates long arrays (more than 10 elements)
+* `ActiveRecord::Base#attribute_for_inspect` now truncates long arrays (more than 10 elements).
*Jan Bernacki*
-* Allow for the name of the schema_migrations table to be configured.
+* Allow for the name of the `schema_migrations` table to be configured.
*Jerad Phelps*
@@ -94,6 +157,7 @@
*Severin Schoepke*
* `ActiveRecord::Store` works together with PG `hstore` columns.
+
Fixes #12452.
*Yves Senn*