mirror of
https://github.com/internetee/registry.git
synced 2025-05-16 17:37:17 +02:00
Remove unused code
This commit is contained in:
parent
b14cc88ded
commit
6d7701e52f
2 changed files with 2 additions and 24 deletions
|
@ -1,7 +1,6 @@
|
|||
module Admin
|
||||
class SettingsController < BaseController
|
||||
load_and_authorize_resource
|
||||
before_action :set_setting_group, only: [:show, :update]
|
||||
|
||||
def index
|
||||
@settings = Setting.unscoped
|
||||
|
@ -22,30 +21,9 @@ module Admin
|
|||
end
|
||||
end
|
||||
|
||||
def show;
|
||||
end
|
||||
|
||||
def update
|
||||
if @setting_group.update(setting_group_params)
|
||||
flash[:notice] = I18n.t('setting_updated')
|
||||
redirect_to [:admin, @setting_group]
|
||||
else
|
||||
flash[:alert] = I18n.t('failed_to_update_setting')
|
||||
render 'show'
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def set_setting_group
|
||||
@setting_group = SettingGroup.find(params[:id])
|
||||
end
|
||||
|
||||
def setting_group_params
|
||||
params.require(:setting_group).permit(settings_attributes: [:value, :id])
|
||||
end
|
||||
|
||||
def casted_settings # rubocop:disable Metrics/MethodLength
|
||||
def casted_settings
|
||||
settings = {}
|
||||
|
||||
ints = [
|
||||
|
|
|
@ -220,7 +220,7 @@ Rails.application.routes.draw do
|
|||
end
|
||||
end
|
||||
|
||||
resources :settings
|
||||
resources :settings, only: %i[index create]
|
||||
|
||||
resources :blocked_domains do
|
||||
member do
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue