Module: HasWiki

Extended by:
ActiveSupport::Concern
Included in:
Project
Defined in:
app/models/concerns/has_wiki.rb

Instance Method Summary collapse

Instance Method Details

#create_wikiObject


10
11
12
13
14
15
16
# File 'app/models/concerns/has_wiki.rb', line 10

def create_wiki
  wiki.wiki
  true
rescue Wiki::CouldNotCreateWikiError
  errors.add(:base, _('Failed to create wiki'))
  false
end

#wikiObject


18
19
20
21
22
# File 'app/models/concerns/has_wiki.rb', line 18

def wiki
  strong_memoize(:wiki) do
    Wiki.for_container(self, self.default_owner)
  end
end

#wiki_repository_exists?Boolean

Returns:

  • (Boolean)

24
25
26
# File 'app/models/concerns/has_wiki.rb', line 24

def wiki_repository_exists?
  wiki.repository_exists?
end