diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2012-09-28 10:06:36 -0700 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2012-09-28 10:06:36 -0700 |
commit | f9c63ad56da541fa8fc007c01de64ed623053fd2 (patch) | |
tree | 123df5835785e57ae8dfe93ba87481f77de06377 /activerecord | |
parent | f63dd4acd44291c582a398b30479ed8c8a2e56a4 (diff) | |
parent | bca66a3547ac166eccac3e8cfead3d93b3d0921b (diff) | |
download | rails-f9c63ad56da541fa8fc007c01de64ed623053fd2.tar.gz rails-f9c63ad56da541fa8fc007c01de64ed623053fd2.tar.bz2 rails-f9c63ad56da541fa8fc007c01de64ed623053fd2.zip |
Merge pull request #7776 from smartinez87/changelog_entry
Add #update_columns entry to AR Changelog. [ci skip]
Diffstat (limited to 'activerecord')
-rw-r--r-- | activerecord/CHANGELOG.md | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/activerecord/CHANGELOG.md b/activerecord/CHANGELOG.md index 344ee6416d..d52d6a7fde 100644 --- a/activerecord/CHANGELOG.md +++ b/activerecord/CHANGELOG.md @@ -1,5 +1,16 @@ ## Rails 4.0.0 (unreleased) ## +* 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* + * Allow before and after validations to take an array of lifecycle events *John Foley* |