diff options
Diffstat (limited to 'activerecord/CHANGELOG.md')
-rw-r--r-- | activerecord/CHANGELOG.md | 52 |
1 files changed, 37 insertions, 15 deletions
diff --git a/activerecord/CHANGELOG.md b/activerecord/CHANGELOG.md index aee8f8d1f7..67bec5f38e 100644 --- a/activerecord/CHANGELOG.md +++ b/activerecord/CHANGELOG.md @@ -1,5 +1,22 @@ ## Rails 4.0.0 (unreleased) ## +* Support for partial inserts. + + When inserting new records, only the fields which have been changed + from the defaults will actually be included in the INSERT statement. + The other fields will be populated by the database. + + This is more efficient, and also means that it will be safe to + remove database columns without getting subsequent errors in running + app processes (so long as the code in those processes doesn't + contain any references to the removed column). + + *Jon Leighton* + +* Allow before and after validations to take an array of lifecycle events + + *John Foley* + * Support for specifying transaction isolation level If your database supports setting the isolation level for a transaction, you can set @@ -76,21 +93,6 @@ *kennyj* -* Fix `find_in_batches` when primary_key is set other than id. - You can now use this method with the primary key which is not integer-based. - - Example: - - class Post < ActiveRecord::Base - self.primary_key = :title - end - - Post.find_in_batches(start: 'My First Post') do |batch| - batch.each { |post| post.author.greeting } - end - - *Toshiyuki Kawanishi* - * You can now override the generated accessor methods for stored attributes and reuse the original behavior with `read_store_attribute` and `write_store_attribute`, which are counterparts to `read_attribute` and `write_attribute`. @@ -299,6 +301,15 @@ *Jon Leighton* +* `Relation#order`: make new order prepend old one. + + User.order("name asc").order("created_at desc") + # SELECT * FROM users ORDER BY created_at desc, name asc + + This also affects order defined in `default_scope` or any kind of associations. + + *Bogdan Gusiev* + * `Model.all` now returns an `ActiveRecord::Relation`, rather than an array of records. Use `Relation#to_a` if you really want an array. @@ -328,6 +339,17 @@ *Jon Leighton* +* Added `#update_columns` method which updates the attributes from + the passed-in hash without calling save, hence skipping validations and + callbacks. `ActiveRecordError` will be raised when called on new objects + or when at least one of the attributes is marked as read only. + + post.attributes # => {"id"=>2, "title"=>"My title", "body"=>"My content", "author"=>"Peter"} + post.update_columns(title: 'New title', author: 'Sebastian') # => true + post.attributes # => {"id"=>2, "title"=>"New title", "body"=>"My content", "author"=>"Sebastian"} + + *Sebastian Martinez + Rafael Mendonça França* + * The migration generator now creates a join table with (commented) indexes every time the migration name contains the word `join_table`: |