DEV: rename ReadOnly module to ReadOnlyHeader

This commit is contained in:
Régis Hanol 2019-05-06 16:07:49 +02:00
parent 33e06dd796
commit e2e72f4e8e
3 changed files with 7 additions and 7 deletions

View File

@ -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

View File

@ -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

View File

@ -1,6 +1,6 @@
# frozen_string_literal: true
module ReadOnly
module ReadOnlyHeader
def check_readonly_mode
@readonly_mode = Discourse.readonly_mode?