Sha256: 2827e2aad9f144acc3e45eb056434034ce6e5ffeed8f5c54aa537c750fd8c95a
Contents?: true
Size: 1.21 KB
Versions: 3
Compression:
Stored size: 1.21 KB
Contents
module Ecoportal module API class V2 class Page class Stage < Common::Content::DoubleModel passkey :id passforced :patch_ver, default: 1 passthrough :name, :ordering passarray :subtags, order_matters: false passarray :section_ids passthrough :status passboolean :complete, :lock_after_completion embeds_many :permits, klass: "Ecoportal::API::V2::Page::Permit" passboolean :disable_direct_permissions passboolean :creator_enabled, :creator_editable embeds_one :creator_flags, klass: "Ecoportal::API::V2::Page::PermissionFlags" passthrough :can 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 def add_section(*secs) secs.each {|sec| section_ids.insert_one(sec.id)} self end end end end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
ecoportal-api-v2-0.8.12 | lib/ecoportal/api/v2/page/stage.rb |
ecoportal-api-v2-0.8.11 | lib/ecoportal/api/v2/page/stage.rb |
ecoportal-api-v2-0.8.10 | lib/ecoportal/api/v2/page/stage.rb |