Skip to content

Commit bca66a3

Browse files
committed
Add #update_columns entry to AR Changelog.
1 parent f63dd4a commit bca66a3

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

activerecord/CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
## Rails 4.0.0 (unreleased) ##
22

3+
* Added `#update_columns` method which updates the attributes from
4+
the passed-in hash without calling save, hence skipping validations and
5+
callbacks. `ActiveRecordError` will be raised when called on new objects
6+
or when at least one of the attributes is marked as read only.
7+
8+
post.attributes # => {"id"=>2, "title"=>"My title", "body"=>"My content", "author"=>"Peter"}
9+
post.update_columns({title: 'New title', author: 'Sebastian'}) # => true
10+
post.attributes # => {"id"=>2, "title"=>"New title", "body"=>"My content", "author"=>"Sebastian"}
11+
12+
*Sebastian Martinez*
13+
314
* Allow before and after validations to take an array of lifecycle events
415

516
*John Foley*

0 commit comments

Comments
 (0)