From 31850c6ca118b7828dbaa3ad1a87dab4287718f5 Mon Sep 17 00:00:00 2001 From: hellekin Date: Thu, 8 Oct 2020 22:10:41 +0200 Subject: Add categories, sections, and import data --- app/models/resource.rb | 1 + app/models/section.rb | 1 + 2 files changed, 2 insertions(+) (limited to 'app') diff --git a/app/models/resource.rb b/app/models/resource.rb index e67d164..cd43bf9 100644 --- a/app/models/resource.rb +++ b/app/models/resource.rb @@ -3,6 +3,7 @@ class Resource < ApplicationRecord include UUIDParameter belongs_to :agent + has_and_belongs_to_many :sections # Figure out the requested property name def method_missing(name, *args, &block) diff --git a/app/models/section.rb b/app/models/section.rb index 0a1fbf2..6cfeb38 100644 --- a/app/models/section.rb +++ b/app/models/section.rb @@ -1,6 +1,7 @@ class Section < ApplicationRecord belongs_to :category has_one :taxonomy, through: :category + has_and_belongs_to_many :resources acts_as_list column: :rank, scope: :category -- cgit v1.2.3