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

Version Path
kuhsaft-2.4.2 lib/kuhsaft/page_tree.rb
kuhsaft-2.4.1 lib/kuhsaft/page_tree.rb
kuhsaft-2.4.0 lib/kuhsaft/page_tree.rb
kuhsaft-2.3.6 lib/kuhsaft/page_tree.rb
kuhsaft-2.3.5 lib/kuhsaft/page_tree.rb
kuhsaft-2.3.4 lib/kuhsaft/page_tree.rb
kuhsaft-2.3.3 lib/kuhsaft/page_tree.rb
kuhsaft-2.3.2 lib/kuhsaft/page_tree.rb
kuhsaft-2.3.1 lib/kuhsaft/page_tree.rb
kuhsaft-2.3.0 lib/kuhsaft/page_tree.rb
kuhsaft-2.2.6 lib/kuhsaft/page_tree.rb
kuhsaft-2.2.5 lib/kuhsaft/page_tree.rb
kuhsaft-2.2.4 lib/kuhsaft/page_tree.rb
kuhsaft-2.2.3 lib/kuhsaft/page_tree.rb
kuhsaft-2.2.2 lib/kuhsaft/page_tree.rb
kuhsaft-2.2.1 lib/kuhsaft/page_tree.rb
kuhsaft-2.2.0 lib/kuhsaft/page_tree.rb
kuhsaft-2.1.2 lib/kuhsaft/page_tree.rb
kuhsaft-2.1.1 lib/kuhsaft/page_tree.rb
kuhsaft-2.1.0 lib/kuhsaft/page_tree.rb