Skip to content

Commit

Permalink
Save all pages just once
Browse files Browse the repository at this point in the history
  • Loading branch information
avonderluft committed May 3, 2024
1 parent 6cbb6d3 commit 08e6755
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/controllers/concerns/occams/reorder_action.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ def reorder
resource_class = self.class.reorder_action_resource
(params.permit(order: [])[:order] || []).each_with_index do |id, index|
resource_class.where(id: id).update_all(position: index)
if resource_class == ::Occams::Cms::Page
Occams::Cms::Page.all.each(&:save!)
end
end
if resource_class == ::Occams::Cms::Page
Occams::Cms::Page.all.each(&:save!)
end
head :ok
end
Expand Down

0 comments on commit 08e6755

Please sign in to comment.