11 lines
237 B
11 lines
237 B
3 years ago
|
module DeviseHelper
|
||
|
def flash_to_model_errors(resource)
|
||
|
if flash.alert
|
||
|
if flash.alert != I18n.t("devise.failure.unauthenticated")
|
||
|
resource.errors.add :base, flash.alert
|
||
|
end
|
||
|
flash.discard
|
||
|
end
|
||
|
end
|
||
|
end
|