Patch #26727

udpate_all

Added by jwjw yy over 5 years ago. Updated 6 months ago.

Status:Needs feedbackStart date:
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:Code cleanup/refactoring
Target version:-

Description

/app/controllers/wiki_controller.rb
272        @page.children.each do |child|
273          child.update_attribute(:parent, reassign_to)
274        end

could use

@page.children.update_all(parent: reassign_to)

History

#1 Updated by Toshi MARUYAMA over 5 years ago

  • Description updated (diff)
  • Category set to Code cleanup/refactoring
  • Status changed from New to Needs feedback

Please post by patch.

#2 Updated by Toshi MARUYAMA over 5 years ago

Toshi MARUYAMA wrote:

Please post by patch.

Please post by attachment patch file.

#3 Updated by Go MAEDA 6 months ago

I don't think the `update_attribute` can be replaced with `update_all` because it does not invoke callbacks.

Also available in: Atom PDF