We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b6497af commit ce64b6bCopy full SHA for ce64b6b
1 file changed
app/models/news.rb
@@ -260,10 +260,12 @@ def nb_editors
260
end
261
262
def reorganize(params)
263
- Paragraph.where(news_id: self.id).delete_all
264
- self.attributes = params
265
- create_parts
266
- save
+ self.transaction do
+ Paragraph.where(news_id: self.id).delete_all
+ self.attributes = params
+ create_parts
267
+ save
268
+ end
269
unlock
270
271
0 commit comments