Skip to content
Snippets Groups Projects
Commit bf62c15c authored by pabois's avatar pabois
Browse files

Merge branch 'master' of github.com:noesya/osuny

parents 0d6ecd60 c31e0b52
No related branches found
No related tags found
No related merge requests found
......@@ -3,6 +3,7 @@
# Table name: communication_website_menus
#
# id :uuid not null, primary key
# github_path :text
# identifier :string
# title :string
# created_at :datetime not null
......@@ -39,14 +40,12 @@ class Communication::Website::Menu < ApplicationRecord
end
def github_path_generated
"_data/menu.yml"
"_data/menus.yml"
end
def to_jekyll
website.menus.map { |menu|
{
menu.identifier => menu.items.root.ordered.map(&:to_jekyll_hash)
}
}.to_yaml
[menu.identifier, menu.items.root.ordered.map(&:to_jekyll_hash)]
}.to_h.to_yaml
end
end
class AddGithubPathToCommunicationWebsiteMenus < ActiveRecord::Migration[6.1]
def change
add_column :communication_website_menus, :github_path, :text
end
end
......@@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 2021_11_03_141506) do
ActiveRecord::Schema.define(version: 2021_11_03_161133) do
# These are extensions that must be enabled in order to support this database
enable_extension "pgcrypto"
......@@ -251,6 +251,7 @@ ActiveRecord::Schema.define(version: 2021_11_03_141506) do
t.string "identifier"
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
t.text "github_path"
t.index ["communication_website_id"], name: "idx_comm_website_menus_on_communication_website_id"
t.index ["university_id"], name: "index_communication_website_menus_on_university_id"
end
......
......@@ -70,7 +70,7 @@ Attributes:
## Export du menu
/data/menu.yml
/_data/menus.yml
```yaml
primary:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment