Skip to content

Commit

Permalink
use presence instead of ternary operator syntax #2048
Browse files Browse the repository at this point in the history
  • Loading branch information
stuzart committed Nov 8, 2024
1 parent 654db48 commit aa7c265
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/controllers/admin_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -539,9 +539,9 @@ def test_email_configuration
smtp_hash_new = { address: params[:address],
enable_starttls_auto: params[:enable_starttls_auto] == '1',
domain: params[:domain],
authentication: (params[:authentication].blank? ? nil : params[:authentication] ),
user_name: (params[:smtp_user_name].blank? ? nil : params[:smtp_user_name]),
password: (params[:smtp_password].blank? ? nil : params[:smtp_password]) }
authentication: params[:authentication].presence,
user_name: params[:smtp_user_name].presence,
password: params[:smtp_password].presence }
smtp_hash_new[:port] = params[:port] if only_integer params[:port], 'port'
ActionMailer::Base.smtp_settings = smtp_hash_new.compact
raise_delivery_errors_setting = ActionMailer::Base.raise_delivery_errors
Expand Down

0 comments on commit aa7c265

Please sign in to comment.