2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
|
# File 'lib/migrations/site/02_page_structure.rb', line 2
def self.up(site)
home = site.pages.where(path: '/').first
home.destroy
home = site.redirect_pages.new
home.title = 'Home'
home.url = '/users'
home.save
site.record_proxy_pages.create_model :sites_page do |sites_pages|
sites_pages.record_class_name = 'ProductionSitesPage'
end
sites = site.sites_pages.new
sites.title = 'Sites'
sites.parent = home
sites.page_layout = 'sites'
sites.show_record_layout = 'site'
sites.save
users = site.pages.new
users.title = 'Users'
users.parent = home
users.page_layout = 'users'
users.save
users.create_eigenmodel
users.model.default_child_model = site.users
users.model.save
site.glob_pages.create_model :git_page do |git_pages|
git_pages.record_class_name = 'GitPage'
end
git = site.git_pages.new
git.title = "git"
git.parent = home
git.save
nav = site..new
nav.name = 'nav'
nav.root = home
ge = nav.exceptions.new
ge.page = git
ge.show = false
ge.save
nav.save
end
|