feat(custom_field_master): add strong params

This commit is contained in:
Luis Castro 2019-08-06 14:48:40 +02:00 committed by Eric Schultz
parent 08b6a98e39
commit c9fba40183
2 changed files with 11 additions and 5 deletions

View file

@ -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

View file

@ -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