Sha256: c8e7660d2c173ec0c89fb59367f2487f2eb449364de65a7d9e88f2d8aea36667
Contents?: true
Size: 401 Bytes
Versions: 29
Compression:
Stored size: 401 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) unless page_content['children'].nil? update(page_content['children'], page.id) end end end end end
Version data entries
29 entries across 29 versions & 1 rubygems