diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2015-08-23 16:15:47 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2015-08-23 16:16:28 -0700 |
commit | f038ed2d2a65da8532e719eff97f985a5f9073ad (patch) | |
tree | c15fa486aa5e09a01358843110a32be64afbe069 /actionpack/lib | |
parent | 861146fdae3c763eb70e72bee9e5404fb66e5eb2 (diff) | |
download | rails-f038ed2d2a65da8532e719eff97f985a5f9073ad.tar.gz rails-f038ed2d2a65da8532e719eff97f985a5f9073ad.tar.bz2 rails-f038ed2d2a65da8532e719eff97f985a5f9073ad.zip |
remove usage of `@env`
try to remove dependencies on `@env` so we can have more flexible
internals
Diffstat (limited to 'actionpack/lib')
-rw-r--r-- | actionpack/lib/action_dispatch/middleware/flash.rb | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/actionpack/lib/action_dispatch/middleware/flash.rb b/actionpack/lib/action_dispatch/middleware/flash.rb index 379e7ffdc5..6041f84834 100644 --- a/actionpack/lib/action_dispatch/middleware/flash.rb +++ b/actionpack/lib/action_dispatch/middleware/flash.rb @@ -6,15 +6,17 @@ module ActionDispatch # read a notice you put there or <tt>flash["notice"] = "hello"</tt> # to put a new one. 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 def flash=(flash) - @env[Flash::KEY] = flash + set_header Flash::KEY, flash end def flash_hash # :nodoc: - @env[Flash::KEY] + get_header Flash::KEY end end |