class Ecoportal::API::V2::Page::Stage

Public Instance Methods

attach_section(section) click to toggle source
# File lib/ecoportal/api/v2/page/stage.rb, line 21
def attach_section(section)
  section_ids.insert_one(section.id)
end
sections() { |sec| ... } click to toggle source
# File lib/ecoportal/api/v2/page/stage.rb, line 13
def sections
  sec_ids = section_ids.to_a
  root.sections.values_at(*sec_ids).select.with_index do |sec, i|
    puts "Warning: section #{id} points to missing section #{sec_ids[i]}" if !sec
    fld && (!block_given? || yield(sec))
  end.sort_by {|sec| sec.weight}
end