|
13 | 13 |
|
14 | 14 | *Jon Leighton*
|
15 | 15 |
|
16 |
| -* Added `#update_columns` method which updates the attributes from |
17 |
| - the passed-in hash without calling save, hence skipping validations and |
18 |
| - callbacks. `ActiveRecordError` will be raised when called on new objects |
19 |
| - or when at least one of the attributes is marked as read only. |
20 |
| - |
21 |
| - post.attributes # => {"id"=>2, "title"=>"My title", "body"=>"My content", "author"=>"Peter"} |
22 |
| - post.update_columns({title: 'New title', author: 'Sebastian'}) # => true |
23 |
| - post.attributes # => {"id"=>2, "title"=>"New title", "body"=>"My content", "author"=>"Sebastian"} |
24 |
| - |
25 |
| - *Sebastian Martinez* |
26 |
| - |
27 | 16 | * Allow before and after validations to take an array of lifecycle events
|
28 | 17 |
|
29 | 18 | *John Foley*
|
|
312 | 301 |
|
313 | 302 | *Jon Leighton*
|
314 | 303 |
|
| 304 | +* `Relation#order`: make new order prepend old one. |
| 305 | + |
| 306 | + User.order("name asc").order("created_at desc") |
| 307 | + # SELECT * FROM users ORDER BY created_at desc, name asc |
| 308 | + |
| 309 | + This also affects order defined in `default_scope` or any kind of associations. |
| 310 | + |
| 311 | + *Bogdan Gusiev* |
| 312 | + |
315 | 313 | * `Model.all` now returns an `ActiveRecord::Relation`, rather than an
|
316 | 314 | array of records. Use `Relation#to_a` if you really want an array.
|
317 | 315 |
|
|
341 | 339 |
|
342 | 340 | *Jon Leighton*
|
343 | 341 |
|
| 342 | +* Added `#update_columns` method which updates the attributes from |
| 343 | + the passed-in hash without calling save, hence skipping validations and |
| 344 | + callbacks. `ActiveRecordError` will be raised when called on new objects |
| 345 | + or when at least one of the attributes is marked as read only. |
| 346 | + |
| 347 | + post.attributes # => {"id"=>2, "title"=>"My title", "body"=>"My content", "author"=>"Peter"} |
| 348 | + post.update_columns(title: 'New title', author: 'Sebastian') # => true |
| 349 | + post.attributes # => {"id"=>2, "title"=>"New title", "body"=>"My content", "author"=>"Sebastian"} |
| 350 | + |
| 351 | + *Sebastian Martinez + Rafael Mendonça França* |
| 352 | + |
344 | 353 | * The migration generator now creates a join table with (commented) indexes every time
|
345 | 354 | the migration name contains the word `join_table`:
|
346 | 355 |
|
|
0 commit comments