diff options
Diffstat (limited to 'activerecord/CHANGELOG.md')
-rw-r--r-- | activerecord/CHANGELOG.md | 110 |
1 files changed, 103 insertions, 7 deletions
diff --git a/activerecord/CHANGELOG.md b/activerecord/CHANGELOG.md index e1cace7d88..6cdf9ebd9b 100644 --- a/activerecord/CHANGELOG.md +++ b/activerecord/CHANGELOG.md @@ -1,3 +1,103 @@ +* PostgreSQL, no longer disables user triggers if system triggers can't be + disabled. Disabling user triggers does not fulfill what the method promises. + Rails currently requires superuser privileges for this method. + + If you absolutely rely on this behavior, consider patching + `disable_referential_integrity`. + + *Yves Senn* + +* Restore aborted transaction state when `disable_referential_integrity` fails + due to missing permissions. + + *Toby Ovod-Everett*, *Yves Senn* + +* PostgreSQL, print warning message if `disable_referential_integrity` fails + due to missing permissions. + + *Andrey Nering*, *Yves Senn* + +* Allow `:limit` option for MySQL bigint primary key support. + + Example: + + create_table :foos, id: :primary_key, limit: 8 do |t| + end + + # or + + create_table :foos, id: false do |t| + t.primary_key :id, limit: 8 + end + + *Ryuta Kamizono* + +* `belongs_to` will now trigger a validation error by default if the association is not present. + You can turn this off on a per-association basis with `optional: true`. + (Note this new default only applies to new Rails apps that will be generated with + `config.active_record.belongs_to_required_by_default = true` in initializer.) + + *Josef Šimánek* + +* Fixed ActiveRecord::Relation#becomes! and changed_attributes issues for type + column. + + Fixes #17139. + + *Miklos Fazekas* + +* Format the time string according to the precision of the time column. + + *Ryuta Kamizono* + +* Allow `:precision` option for time type columns. + + *Ryuta Kamizono* + +* Add `ActiveRecord::Base.suppress` to prevent the receiver from being saved + during the given block. + + For example, here's a pattern of creating notifications when new comments + are posted. (The notification may in turn trigger an email, a push + notification, or just appear in the UI somewhere): + + class Comment < ActiveRecord::Base + belongs_to :commentable, polymorphic: true + after_create -> { Notification.create! comment: self, + recipients: commentable.recipients } + end + + That's what you want the bulk of the time. New comment creates a new + Notification. But there may well be off cases, like copying a commentable + and its comments, where you don't want that. So you'd have a concern + something like this: + + module Copyable + def copy_to(destination) + Notification.suppress do + # Copy logic that creates new comments that we do not want triggering + # notifications. + end + end + end + + *Michael Ryan* + +* `:time` option added for `#touch`. + + Fixes #18905. + + *Hyonjee Joo* + +* Deprecated passing of `start` value to `find_in_batches` and `find_each` + in favour of `begin_at` value. + + *Vipul A M* + +* Add `foreign_key_exists?` method. + + *Tõnis Simo* + * Use SQL COUNT and LIMIT 1 queries for `none?` and `one?` methods if no block or limit is given, instead of loading the entire collection to memory. This applies to relations (e.g. `User.all`) as well as associations (e.g. `account.users`) @@ -20,10 +120,6 @@ *Eugene Gilburg* -* Allow `:precision` option for time type columns. - - *Ryuta Kamizono* - * Have `enum` perform type casting consistently with the rest of Active Record, such as `where`. @@ -32,9 +128,9 @@ * `scoping` no longer pollutes the current scope of sibling classes when using STI. e.x. - StiOne.none.scoping do - StiTwo.all - end + StiOne.none.scoping do + StiTwo.all + end Fixes #18806. |