mirror of
https://github.com/internetee/registry.git
synced 2025-07-03 01:33:36 +02:00
parent
cee4c84edd
commit
2e827125b0
3 changed files with 0 additions and 59 deletions
|
@ -1,31 +0,0 @@
|
|||
# Log all flash messages
|
||||
# rubocop: disable Metrics/CyclomaticComplexity
|
||||
# rubocop: disable Metrics/LineLength
|
||||
module ActionDispatch
|
||||
class Flash
|
||||
# rubocop: disable Metrics/PerceivedComplexity
|
||||
# rubocop: disable Style/MultilineOperationIndentation
|
||||
def call(env)
|
||||
@app.call(env)
|
||||
ensure
|
||||
session = Request::Session.find(env) || {}
|
||||
flash_hash = env[KEY]
|
||||
|
||||
if flash_hash && (flash_hash.present? || session.key?('flash'))
|
||||
session["flash"] = flash_hash.to_session_value
|
||||
|
||||
# EIS custom logging
|
||||
Rails.logger.info "USER MSG: FLASH: #{session['flash']['flashes'].inspect}" if session['flash']
|
||||
# END OF EIS custom logging
|
||||
|
||||
env[KEY] = flash_hash.dup
|
||||
end
|
||||
|
||||
if (!session.respond_to?(:loaded?) || session.loaded?) && # (reset_session uses {}, which doesn't implement #loaded?)
|
||||
session.key?('flash') && session['flash'].nil?
|
||||
session.delete('flash')
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue