From c8ebfc9ce6109301e8850f53520545104ceed8ae Mon Sep 17 00:00:00 2001 From: Jan Sandbrink Date: Mon, 16 Mar 2026 16:26:03 +0100 Subject: [PATCH] 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. --- app/models/wiki_page.rb | 4 ++-- app/models/{wikis => wiki_page}/annotate.rb | 2 +- app/models/{wikis => wiki_page}/diff.rb | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) rename app/models/{wikis => wiki_page}/annotate.rb (98%) rename app/models/{wikis => wiki_page}/diff.rb (96%) diff --git a/app/models/wiki_page.rb b/app/models/wiki_page.rb index 0e1d169a9e0..3636607cfda 100644 --- a/app/models/wiki_page.rb +++ b/app/models/wiki_page.rb @@ -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 diff --git a/app/models/wikis/annotate.rb b/app/models/wiki_page/annotate.rb similarity index 98% rename from app/models/wikis/annotate.rb rename to app/models/wiki_page/annotate.rb index 5a9ea79240f..49bb99494b5 100644 --- a/app/models/wikis/annotate.rb +++ b/app/models/wiki_page/annotate.rb @@ -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) diff --git a/app/models/wikis/diff.rb b/app/models/wiki_page/diff.rb similarity index 96% rename from app/models/wikis/diff.rb rename to app/models/wiki_page/diff.rb index aa186cd88b5..b4f001e5ce7 100644 --- a/app/models/wikis/diff.rb +++ b/app/models/wiki_page/diff.rb @@ -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)