2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
# File 'lib/yodel/models/migrations/14_menu_model.rb', line 2
def self.up(site)
site.records.create_model :menu do ||
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
.record_class_name = 'Menu'
end
end
|