Move two classes to namespace of model using them

They are the only two classes using the namespace called Wikis
so far. We want to use this namespace for a module called `wikis` that
will encapsulate integration with external wikis and the internal OpenProject
wiki.
This commit is contained in:
Jan Sandbrink
2026-03-16 16:26:03 +01:00
parent 706a664443
commit c8ebfc9ce6
3 changed files with 4 additions and 4 deletions
+2 -2
View File
@@ -161,7 +161,7 @@ class WikiPage < ApplicationRecord
content_to = journals.find_by(version: version_to)
content_from = journals.find_by(version: version_from)
content_to && content_from ? Wikis::Diff.new(content_to, content_from) : nil
content_to && content_from ? WikiPage::Diff.new(content_to, content_from) : nil
end
def version
@@ -171,7 +171,7 @@ class WikiPage < ApplicationRecord
def annotate(compare_version = nil)
compare_version = compare_version ? compare_version.to_i : version
c = journals.find_by(version: compare_version)
c ? Wikis::Annotate.new(c) : nil
c ? WikiPage::Annotate.new(c) : nil
end
# Returns true if usr is allowed to edit the page, otherwise false
@@ -28,7 +28,7 @@
# See COPYRIGHT and LICENSE files for more details.
#++
class Wikis::Annotate
class WikiPage::Annotate
attr_reader :lines, :content
def initialize(content)
@@ -28,7 +28,7 @@
# See COPYRIGHT and LICENSE files for more details.
#++
class Wikis::Diff < Redmine::Helpers::Diff
class WikiPage::Diff < Redmine::Helpers::Diff
attr_reader :content_to, :content_from
def initialize(content_to, content_from)