Improved params handling regarding RoR 5.0.

This commit is contained in:
Martin Edenhofer 2017-09-12 16:38:32 +02:00
parent 7d76805f98
commit 181dd55140

View file

@ -92,7 +92,7 @@ class ChannelsEmailController < ApplicationController
end end
def verify def verify
params.permit!
email = params[:email] || params[:meta][:email] email = params[:email] || params[:meta][:email]
email = email.downcase email = email.downcase
channel_id = params[:channel_id] channel_id = params[:channel_id]
@ -105,8 +105,8 @@ class ChannelsEmailController < ApplicationController
# check delivery for 30 sek. # check delivery for 30 sek.
result = EmailHelper::Verify.email( result = EmailHelper::Verify.email(
outbound: params[:outbound], outbound: params[:outbound].to_h,
inbound: params[:inbound], inbound: params[:inbound].to_h,
sender: email, sender: email,
subject: params[:subject], subject: params[:subject],
) )
@ -126,8 +126,8 @@ class ChannelsEmailController < ApplicationController
channel = Channel.find(channel_id) channel = Channel.find(channel_id)
channel.update_attributes( channel.update_attributes(
options: { options: {
inbound: params[:inbound], inbound: params[:inbound].to_h,
outbound: params[:outbound], outbound: params[:outbound].to_h,
}, },
group_id: params[:group_id], group_id: params[:group_id],
last_log_in: nil, last_log_in: nil,
@ -143,8 +143,8 @@ class ChannelsEmailController < ApplicationController
channel = Channel.create( channel = Channel.create(
area: 'Email::Account', area: 'Email::Account',
options: { options: {
inbound: params[:inbound], inbound: params[:inbound].to_h,
outbound: params[:outbound], outbound: params[:outbound].to_h,
}, },
group_id: params[:group_id], group_id: params[:group_id],
last_log_in: nil, last_log_in: nil,
@ -210,6 +210,7 @@ class ChannelsEmailController < ApplicationController
end end
def notification def notification
params.permit!
check_online_service check_online_service
@ -230,7 +231,7 @@ class ChannelsEmailController < ApplicationController
channel.options = { channel.options = {
outbound: { outbound: {
adapter: adapter, adapter: adapter,
options: params[:options], options: params[:options].to_h,
}, },
} }
channel.status_out = 'ok' channel.status_out = 'ok'