PERF: Memoize `SkippedEmailLog.reason_types`.

This commit is contained in:
Guo Xiang Tan 2018-08-21 10:25:06 +08:00
parent 2c70d3f443
commit 7c69fa8cfd
1 changed files with 1 additions and 1 deletions

View File

@ -12,7 +12,7 @@ class SkippedEmailLog < ActiveRecord::Base
validate :ensure_valid_reason_type
def self.reason_types
Enum.new(
@types ||= Enum.new(
custom: 1,
exceeded_emails_limit: 2,
exceeded_bounces_limit: 3,