2018-07-25 05:30:33 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2016-12-26 10:07:40 -05:00
|
|
|
class WikiDirectory
|
|
|
|
include ActiveModel::Validations
|
|
|
|
|
2016-12-31 14:27:03 -05:00
|
|
|
attr_accessor :slug, :pages
|
2016-12-26 10:07:40 -05:00
|
|
|
|
|
|
|
validates :slug, presence: true
|
|
|
|
|
2016-12-31 14:27:03 -05:00
|
|
|
def initialize(slug, pages = [])
|
2016-12-26 10:07:40 -05:00
|
|
|
@slug = slug
|
|
|
|
@pages = pages
|
|
|
|
end
|
2016-12-26 20:52:26 -05:00
|
|
|
|
2019-10-31 17:06:28 -04:00
|
|
|
# Relative path to the partial to be used when rendering collections
|
|
|
|
# of this object.
|
|
|
|
def to_partial_path
|
2020-06-11 11:08:36 -04:00
|
|
|
'../shared/wikis/wiki_directory'
|
2016-12-26 20:52:26 -05:00
|
|
|
end
|
2016-12-26 10:07:40 -05:00
|
|
|
end
|