aboutsummaryrefslogtreecommitdiffstats
path: root/guides/source/4_0_release_notes.md
diff options
context:
space:
mode:
authorSebastian Martinez <sebastian@wyeworks.com>2012-09-27 13:01:21 -0300
committerVijay Dev <vijaydev.cse@gmail.com>2012-09-27 23:30:07 +0530
commit46f0fc6968493132da417e3e06f3c8aa09f54038 (patch)
tree25efe4d08f5682b18b08b308e78fb584daf03795 /guides/source/4_0_release_notes.md
parent7a2b8099efae1f51024dd9a198e8e21fae2071e7 (diff)
downloadrails-46f0fc6968493132da417e3e06f3c8aa09f54038.tar.gz
rails-46f0fc6968493132da417e3e06f3c8aa09f54038.tar.bz2
rails-46f0fc6968493132da417e3e06f3c8aa09f54038.zip
Add #update_columns entry in Rails 4.0 release notes [ci skip]
Diffstat (limited to 'guides/source/4_0_release_notes.md')
-rw-r--r--guides/source/4_0_release_notes.md8
1 files changed, 8 insertions, 0 deletions
diff --git a/guides/source/4_0_release_notes.md b/guides/source/4_0_release_notes.md
index 183715491a..cce5bc5331 100644
--- a/guides/source/4_0_release_notes.md
+++ b/guides/source/4_0_release_notes.md
@@ -652,6 +652,14 @@ Active Record
* PostgreSQL hstore types are automatically deserialized from the database.
+* 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.
+
+ ```ruby
+ 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"}
+ ```
+
### Deprecations
* Deprecated most of the 'dynamic finder' methods. All dynamic methods except for `find_by_...` and `find_by_...!` are deprecated. Here's how you can rewrite the code: