feat: Add the ability for a super admin to define account limits (#3946)

Fixes: #3773
This commit is contained in:
Sojan Jose
2022-02-14 15:55:08 +05:30
committed by GitHub
parent edd93ca4a3
commit 3d73d8935a
9 changed files with 71 additions and 14 deletions

View File

@@ -33,11 +33,11 @@ class SuperAdmin::AccountsController < SuperAdmin::ApplicationController
# empty values into nil values. It uses other APIs such as `resource_class`
# and `dashboard`:
#
# def resource_params
# params.require(resource_class.model_name.param_key).
# permit(dashboard.permitted_attributes).
# transform_values { |value| value == "" ? nil : value }
# end
def resource_params
permitted_params = super
permitted_params[:limits] = permitted_params[:limits].to_h.compact
permitted_params
end
# See https://administrate-prototype.herokuapp.com/customizing_controller_actions
# for more information