Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/glacials/splits-io. a speedrunning data store and analysis engine splits.io
Something went wrong. Try again.
123456789101112131415161718class Api::V3::ApplicationController < ActionController::Base include Rails::Pagination
before_action :read_only_mode, if: -> { ENV["READ_ONLY_MODE"] == "1" }
def options headers["Allow"] = "POST, PUT, DELETE, GET, OPTIONS" end
def read_only_mode write_actions = %w[create edit destroy] write_methods = %w[POST PUT DELETE PATCH] if write_actions.include?(action_name) || write_methods.include?(request.method) render template: "pages/read_only_mode" end endend