mirror of
https://0xacab.org/sutty/sutty
synced 2024-07-05 23:25:46 +00:00
22 lines
399 B
Ruby
22 lines
399 B
Ruby
|
# frozen_string_literal: true
|
||
|
|
||
|
module Devise
|
||
|
module FailureAppDecorator
|
||
|
extend ActiveSupport::Concern
|
||
|
|
||
|
included do
|
||
|
include AbstractController::Callbacks
|
||
|
|
||
|
around_action :set_locale
|
||
|
|
||
|
private
|
||
|
|
||
|
def set_locale(&action)
|
||
|
I18n.with_locale(session[:locale] || I18n.locale, &action)
|
||
|
end
|
||
|
end
|
||
|
end
|
||
|
end
|
||
|
|
||
|
Devise::FailureApp.include Devise::FailureAppDecorator
|