Skip to content

Commit

Permalink
fix: enum values must not be empty
Browse files Browse the repository at this point in the history
  • Loading branch information
colinux committed Jan 20, 2025
1 parent f5f4864 commit 4796974
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion app/models/safe_mailer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ class SafeMailer < ApplicationRecord
raise if SafeMailer.count == 1
end

enum :forced_delivery_method, (Rails.application.config.action_mailer&.balancer_settings&.keys || []).to_h { |k| [k.to_sym, k.to_s] }
if Rails.application.config.action_mailer.balancer_settings.present?
enum :forced_delivery_method, (Rails.application.config.action_mailer.balancer_settings.keys || []).to_h { |k| [k.to_sym, k.to_s] }
end

def self.forced_delivery_method
first&.forced_delivery_method
Expand Down

0 comments on commit 4796974

Please sign in to comment.