diff options
Diffstat (limited to 'activerecord/CHANGELOG.md')
-rw-r--r-- | activerecord/CHANGELOG.md | 57 |
1 files changed, 54 insertions, 3 deletions
diff --git a/activerecord/CHANGELOG.md b/activerecord/CHANGELOG.md index ce1f1102d5..2d260f2bf5 100644 --- a/activerecord/CHANGELOG.md +++ b/activerecord/CHANGELOG.md @@ -1,15 +1,66 @@ +* Fix query attribute method on user-defined attribute to be aware of typecasted value. + + For example, the following code no longer return false as casted non-empty string: + + ``` + class Post < ActiveRecord::Base + attribute :user_defined_text, :text + end + + Post.new(user_defined_text: "false").user_defined_text? # => true + ``` + + *Yuji Kamijima* + +* Quote empty ranges like other empty enumerables. + + *Patrick Rebsch* + +* Add `insert_all`/`insert_all!`/`upsert_all` methods to `ActiveRecord::Persistence`, + allowing bulk inserts akin to the bulk updates provided by `update_all` and + bulk deletes by `delete_all`. + + Supports skipping or upserting duplicates through the `ON CONFLICT` syntax + for Postgres (9.5+) and Sqlite (3.24+) and `ON DUPLICATE KEY UPDATE` syntax + for MySQL. + + *Bob Lail* + +* Add `rails db:seed:replant` that truncates tables of each database + for current environment and loads the seeds. + + *bogdanvlviv*, *DHH* + +* Add `ActiveRecord::Base.connection.truncate` for SQLite3 adapter. + + *bogdanvlviv* + +* Deprecate mismatched collation comparison for uniqueness validator. + + Uniqueness validator will no longer enforce case sensitive comparison in Rails 6.1. + To continue case sensitive comparison on the case insensitive column, + pass `case_sensitive: true` option explicitly to the uniqueness validator. + + *Ryuta Kamizono* + +* Add `reselect` method. This is a short-hand for `unscope(:select).select(fields)`. + + Fixes #27340. + + *Willian Gustavo Veiga* + * Add negative scopes for all enum values. Example: - + class Post < ActiveRecord::Base enum status: %i[ drafted active trashed ] end - + Post.not_drafted # => where.not(status: :drafted) Post.not_active # => where.not(status: :active) Post.not_trashed # => where.not(status: :trashed) - + *DHH* * Fix different `count` calculation when using `size` with manual `select` with DISTINCT. |