BigW Consortium Gitlab

wiki_directory.rb 359 Bytes
Newer Older
1 2 3
class WikiDirectory
  include ActiveModel::Validations

4
  attr_accessor :slug, :pages
5 6 7

  validates :slug, presence: true

8
  def initialize(slug, pages = [])
9 10 11
    @slug = slug
    @pages = pages
  end
12 13 14 15 16 17

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