From c9fba4018377cfda7cb1c6986b8e689fd09ff05d Mon Sep 17 00:00:00 2001 From: Luis Castro Date: Tue, 6 Aug 2019 14:48:40 +0200 Subject: [PATCH] feat(custom_field_master): add strong params --- .../nonprofits/custom_field_masters_controller.rb | 6 ++++++ app/models/custom_field_master.rb | 10 +++++----- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/app/controllers/nonprofits/custom_field_masters_controller.rb b/app/controllers/nonprofits/custom_field_masters_controller.rb index eda2ab8a..1d846a91 100644 --- a/app/controllers/nonprofits/custom_field_masters_controller.rb +++ b/app/controllers/nonprofits/custom_field_masters_controller.rb @@ -23,5 +23,11 @@ module Nonprofits custom_field_master.custom_field_joins.destroy_all render json: {}, status: :ok end + + private + + def custom_field_master_params + params.require(:custom_field_master).permit(:nonprofit, :nonprofit_id, :name, :deleted, :created_at) + end end end diff --git a/app/models/custom_field_master.rb b/app/models/custom_field_master.rb index d2e386c0..15f5fe08 100644 --- a/app/models/custom_field_master.rb +++ b/app/models/custom_field_master.rb @@ -2,11 +2,11 @@ # License: AGPL-3.0-or-later WITH Web-Template-Output-Additional-Permission-3.0-or-later class CustomFieldMaster < ApplicationRecord - # attr_accessible \ - # :nonprofit, :nonprofit_id, - # :name, - # :deleted, - # :created_at + # :nonprofit, + # :nonprofit_id, + # :name, + # :deleted, + # :created_at validates :name, presence: true validate :no_dupes, on: :create