Class: Faktory::Middleware::I18n::Worker

Inherits:
Object
  • Object
show all
Defined in:
lib/faktory/middleware/i18n.rb

Overview

Pull the msg locale out and set the current thread to use it.

Instance Method Summary collapse

Instance Method Details

#call(jobinst, payload) ⇒ Object



21
22
23
24
# File 'lib/faktory/middleware/i18n.rb', line 21

def call(jobinst, payload)
  locale = payload.dig("custom", "locale") || I18n.default_locale
  I18n.with_locale(locale) { yield }
end