mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
remove usage of @env
try to remove dependencies on `@env` so we can have more flexible internals
This commit is contained in:
parent
861146fdae
commit
f038ed2d2a
1 changed files with 5 additions and 3 deletions
|
@ -6,15 +6,17 @@ module ActionDispatch
|
||||||
# read a notice you put there or <tt>flash["notice"] = "hello"</tt>
|
# read a notice you put there or <tt>flash["notice"] = "hello"</tt>
|
||||||
# to put a new one.
|
# to put a new one.
|
||||||
def flash
|
def flash
|
||||||
@env[Flash::KEY] ||= Flash::FlashHash.from_session_value(session["flash"])
|
flash = flash_hash
|
||||||
|
return flash if flash
|
||||||
|
self.flash = Flash::FlashHash.from_session_value(session["flash"])
|
||||||
end
|
end
|
||||||
|
|
||||||
def flash=(flash)
|
def flash=(flash)
|
||||||
@env[Flash::KEY] = flash
|
set_header Flash::KEY, flash
|
||||||
end
|
end
|
||||||
|
|
||||||
def flash_hash # :nodoc:
|
def flash_hash # :nodoc:
|
||||||
@env[Flash::KEY]
|
get_header Flash::KEY
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue