gitlab-org--gitlab-foss/app/models/wiki_directory.rb

19 lines
359 B
Ruby
Raw Normal View History

2016-12-26 10:07:40 -05:00
class WikiDirectory
include ActiveModel::Validations
attr_accessor :slug, :pages
2016-12-26 10:07:40 -05:00
validates :slug, presence: true
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
# 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 10:07:40 -05:00
end