summaryrefslogtreecommitdiff
path: root/app/models/wiki_directory.rb
blob: df2fe25b08b556226b86e5575f344ac84129736a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# frozen_string_literal: true

class WikiDirectory
  include ActiveModel::Validations

  attr_accessor :slug, :pages

  validates :slug, presence: true

  def initialize(slug, pages = [])
    @slug = slug
    @pages = pages
  end

  # Relative path to the partial to be used when rendering collections
  # of this object.
  def to_partial_path
    '../shared/wikis/wiki_directory'
  end
end