mirror of
https://github.com/discourse/discourse.git
synced 2024-11-30 19:05:18 +08:00
17 lines
359 B
Ruby
17 lines
359 B
Ruby
require_dependency 'i18n'
|
|
require_dependency 'user'
|
|
|
|
module Jobs
|
|
class NarrativeInit < Jobs::Base
|
|
sidekiq_options queue: 'critical'
|
|
|
|
def execute(args)
|
|
if user = User.find_by(id: args[:user_id])
|
|
I18n.with_locale(user.effective_locale) do
|
|
args[:klass].constantize.new.input(:init, user)
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end
|