Skip to content

Commit

Permalink
deprecated direct hash access to the flash in Mojolicious::Controller
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Sep 16, 2011
1 parent b7710b1 commit 957bc82
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions Changes
@@ -1,6 +1,8 @@
This file documents the revision history for Perl extension Mojolicious.

1.99 2011-09-16 00:00:00
- Deprecated direct hash access to the flash in
Mojolicious::Controller.
- Added EXPERIMENTAL profile helper.
- Improved documentation.
- Fixed small redirect_to bug. (judofyr, sri)
Expand Down
6 changes: 3 additions & 3 deletions lib/Mojolicious/Controller.pm
Expand Up @@ -123,8 +123,9 @@ sub flash {
$flash = {} unless $flash && ref $flash eq 'HASH';
$session->{new_flash} = $flash;

# Hash
return $flash unless @_;
# DEPRECATED in Smiling Face With Sunglasses!
warn "Direct hash access to the flash is DEPRECATED!!!\n" and return $flash
unless @_;

# Set
my $values = @_ > 1 ? {@_} : $_[0];
Expand Down Expand Up @@ -760,7 +761,6 @@ Gracefully end WebSocket connection or long poll stream.
=head2 C<flash>
my $flash = $c->flash;
my $foo = $c->flash('foo');
$c = $c->flash({foo => 'bar'});
$c = $c->flash(foo => 'bar');
Expand Down

0 comments on commit 957bc82

Please sign in to comment.