feat(campaign_gift): add strong params
This commit is contained in:
parent
51a4902991
commit
593df27f13
2 changed files with 11 additions and 7 deletions
|
@ -4,6 +4,12 @@
|
|||
class CampaignGiftsController < ApplicationController
|
||||
# post /campaign_gifts
|
||||
def create
|
||||
json_saved CreateCampaignGift.create params[:campaign_gift]
|
||||
json_saved CreateCampaignGift.create campaign_gift_params
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def campaign_gift_params
|
||||
params.require(:campaign_gift).permit(:donation_id, :donation, :campaign_gift_option, :campaign_gift_option_id)
|
||||
end
|
||||
end
|
||||
|
|
|
@ -2,12 +2,10 @@
|
|||
|
||||
# License: AGPL-3.0-or-later WITH Web-Template-Output-Additional-Permission-3.0-or-later
|
||||
class CampaignGift < ApplicationRecord
|
||||
# TODO
|
||||
# attr_accessible \
|
||||
# :donation_id,
|
||||
# :donation,
|
||||
# :campaign_gift_option,
|
||||
# :campaign_gift_option_id
|
||||
# :donation_id,
|
||||
# :donation,
|
||||
# :campaign_gift_option,
|
||||
# :campaign_gift_option_id
|
||||
|
||||
belongs_to :donation
|
||||
belongs_to :campaign_gift_option
|
||||
|
|
Loading…
Reference in a new issue