diff --git a/app/controllers/webhook_settings_controller.rb b/app/controllers/webhook_settings_controller.rb index e512413..b85430b 100644 --- a/app/controllers/webhook_settings_controller.rb +++ b/app/controllers/webhook_settings_controller.rb @@ -20,9 +20,7 @@ class WebhookSettingsController < ApplicationController id = params[:webhook_id] webhook = Webhook.where(:project_id => @project.id).where(:id => id).first webhook.url = params[:url] - if webhook.url.empty? - webhook.destroy - elsif webhook.save + if webhook.url.blank? ? webhook.destroy : webhook.save flash[:notice] = l(:notice_successful_update_webhook) else flash[:error] = l(:notice_fail_update_webhook)