Sha256: ad6715d42825e0fd62fcebf72347f96f9fd1bc26c26d07884a0d0bf3a42d23bb

Contents?: true

Size: 566 Bytes

Versions: 3

Compression:

Stored size: 566 Bytes

Contents

class QueuePageModelMigration < Migration
  def self.up(site)
    site.pages.create_model :queue_pages do |queue_pages|
      queue_pages.record_class_name = 'QueuePage'
      queue_pages.allowed_children = []
      queue_pages.allowed_parents = []
      queue_pages.hide_in_admin = true
    end
    
    # default queue page
    home_page = site.pages.where(path: '/').first
    qp = site.queue_pages.new
    qp.show_in_menus = false
    qp.parent = home_page
    qp.title = "Queue"
    qp.save
  end
  
  def self.down(site)
    site.queue_pages.destroy
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
yodel_queue-0.0.7 lib/migrations/01_queue_page_model.rb
yodel_queue-0.0.4 lib/migrations/01_queue_page_model.rb
yodel_queue-0.0.2 lib/migrations/01_queue_page_model.rb