Sha256: 7f1d28d49b07a119461d3f4126bb45386caa7d9fa78875cc8c901944383605f7
Contents?: true
Size: 669 Bytes
Versions: 13
Compression:
Stored size: 669 Bytes
Contents
class MenuModelMigration < Migration def self.up(site) site.records.create_model :menu do |menus| add_one :root, model: :page, validations: {required: {}} add_field :include_root, :boolean, default: false add_field :include_all_children, :boolean, default: true add_field :depth, :integer, default: 0, validations: {required: {}} add_embed_many :exceptions do add_one :page add_field :show, :boolean, default: false add_field :depth, :integer, default: 0, validations: {required: {}} end menus.record_class_name = 'Menu' end end def self.down(site) site.menus.destroy end end
Version data entries
13 entries across 13 versions & 3 rubygems