Sha256: 8e0f750794b55572605b979df20c5496edda81ee22a83941addc7a1487ed572a
Contents?: true
Size: 388 Bytes
Versions: 9
Compression:
Stored size: 388 Bytes
Contents
module Kuhsaft module PageTree extend self def update(params, parent_id = nil) params.each do |page_position, page_content| page = Page.find(page_content['id']) page.update_attributes(parent_id: parent_id, position: page_position) next if page_content['children'].nil? update(page_content['children'], page.id) end end end end
Version data entries
9 entries across 9 versions & 2 rubygems