mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-16 20:46:22 +00:00
45 lines
881 B
Ruby
45 lines
881 B
Ruby
|
# frozen_string_literal: true
|
||
|
|
||
|
# Modificaciones para Blazer
|
||
|
module BlazerDecorator
|
||
|
# No poder obtener información de la base de datos.
|
||
|
module DisableDatabaseInfo
|
||
|
extend ActiveSupport::Concern
|
||
|
|
||
|
included do
|
||
|
def docs; end
|
||
|
|
||
|
def tables; end
|
||
|
|
||
|
def schema; end
|
||
|
end
|
||
|
end
|
||
|
|
||
|
# Deshabilitar edición de consultas y chequeos.
|
||
|
module DisableEdits
|
||
|
extend ActiveSupport::Concern
|
||
|
|
||
|
included do
|
||
|
def create; end
|
||
|
|
||
|
def update; end
|
||
|
|
||
|
def destroy; end
|
||
|
|
||
|
def run; end
|
||
|
|
||
|
def refresh; end
|
||
|
|
||
|
def cancel; end
|
||
|
end
|
||
|
end
|
||
|
end
|
||
|
|
||
|
classes = [Blazer::QueriesController, Blazer::ChecksController, Blazer::DashboardsController]
|
||
|
modules = [BlazerDecorator::DisableDatabaseInfo, BlazerDecorator::DisableEdits]
|
||
|
classes.each do |klass|
|
||
|
modules.each do |modul|
|
||
|
klass.include modul unless klass.included_modules.include? modul
|
||
|
end
|
||
|
end
|