Commit 4c95405ba1d6ad21fd8186ded568210ed1425e31
1 parent
48fc7d7f
Exists in
master
and in
27 other branches
rails3: return article object on copy instead of true/false
Showing
1 changed file
with
2 additions
and
0 deletions
Show diff stats
app/models/article.rb
... | ... | @@ -523,6 +523,7 @@ class Article < ActiveRecord::Base |
523 | 523 | object.send(key.to_s+'=', value) |
524 | 524 | end |
525 | 525 | object.save |
526 | + object | |
526 | 527 | end |
527 | 528 | |
528 | 529 | def copy!(options = {}) |
... | ... | @@ -533,6 +534,7 @@ class Article < ActiveRecord::Base |
533 | 534 | object.send(key.to_s+'=', value) |
534 | 535 | end |
535 | 536 | object.save! |
537 | + object | |
536 | 538 | end |
537 | 539 | |
538 | 540 | ATTRIBUTES_NOT_COPIED = [ | ... | ... |