DEV: rename ReadOnly module to ReadOnlyHeader

DEV: rename ReadOnly module to ReadOnlyHeader

diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb
index 65d688e..ddce493 100644
--- a/app/controllers/application_controller.rb
+++ b/app/controllers/application_controller.rb
@@ -14,7 +14,7 @@ require_dependency 'global_path'
 require_dependency 'secure_session'
 require_dependency 'topic_query'
 require_dependency 'hijack'
-require_dependency 'read_only'
+require_dependency 'read_only_header'
 
 class ApplicationController < ActionController::Base
   include CurrentUser
@@ -22,7 +22,7 @@ class ApplicationController < ActionController::Base
   include JsonError
   include GlobalPath
   include Hijack
-  include ReadOnly
+  include ReadOnlyHeader
 
   attr_reader :theme_ids
 
diff --git a/app/controllers/forums_controller.rb b/app/controllers/forums_controller.rb
index b3b0a74..734d475 100644
--- a/app/controllers/forums_controller.rb
+++ b/app/controllers/forums_controller.rb
@@ -1,18 +1,18 @@
 # frozen_string_literal: true
 
-require "read_only"
+require "read_only_header"
 
 class ForumsController < ActionController::Base
-  include ReadOnly
+  include ReadOnlyHeader
 
   before_action :check_readonly_mode
   after_action  :add_readonly_header
 
   def status
     if $shutdown
-      render plain: 'shutting down', status: 500
+      render plain: "shutting down", status: 500
     else
-      render plain: 'ok'
+      render plain: "ok"
     end
   end
 
diff --git a/lib/read_only.rb b/lib/read_only.rb
deleted file mode 100644
index d095d18..0000000
--- a/lib/read_only.rb
+++ /dev/null
@@ -1,13 +0,0 @@
-# frozen_string_literal: true
-
-module ReadOnly
-
-  def check_readonly_mode
-    @readonly_mode = Discourse.readonly_mode?
-  end
-
-  def add_readonly_header
-    response.headers['Discourse-Readonly'] = 'true' if @readonly_mode
-  end
-
-end
diff --git a/lib/read_only_header.rb b/lib/read_only_header.rb
new file mode 100644
index 0000000..51cb244
--- /dev/null
+++ b/lib/read_only_header.rb
@@ -0,0 +1,13 @@
+# frozen_string_literal: true
+
+module ReadOnlyHeader
+
+  def check_readonly_mode
+    @readonly_mode = Discourse.readonly_mode?
+  end
+
+  def add_readonly_header
+    response.headers['Discourse-Readonly'] = 'true' if @readonly_mode
+  end
+
+end

GitHub sha: e2e72f4e

1 Like

Follow up to FIX: add ReadOnly hear to /srv/status