2016-12-26 15:07:40 +00:00
|
|
|
class WikiDirectory
|
|
|
|
include ActiveModel::Validations
|
|
|
|
|
2016-12-31 19:27:03 +00:00
|
|
|
attr_accessor :slug, :pages
|
2016-12-26 15:07:40 +00:00
|
|
|
|
|
|
|
validates :slug, presence: true
|
|
|
|
|
2016-12-31 19:27:03 +00:00
|
|
|
def initialize(slug, pages = [])
|
2016-12-26 15:07:40 +00:00
|
|
|
@slug = slug
|
|
|
|
@pages = pages
|
|
|
|
end
|
2016-12-27 01:52:26 +00:00
|
|
|
|
|
|
|
# Relative path to the partial to be used when rendering collections
|
|
|
|
# of this object.
|
|
|
|
def to_partial_path
|
|
|
|
'projects/wikis/wiki_directory'
|
|
|
|
end
|
2016-12-26 15:07:40 +00:00
|
|
|
end
|