-
Notifications
You must be signed in to change notification settings - Fork 151
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Augment shorsighted code change in 5ef76b8
The way _column_data_in_storage was unconditionally referenced, would break both id() and ident_values(), which are supposed to construct the identity based on current object state
- Loading branch information
Showing
4 changed files
with
52 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
use strict; | ||
use warnings; | ||
|
||
use Test::More; | ||
use lib qw(t/lib); | ||
use DBICTest; | ||
|
||
my $schema = DBICTest->init_schema(); | ||
|
||
my $artist = $schema->resultset('Artist')->next; | ||
|
||
is_deeply( | ||
[ $artist->id, $artist->ident_condition, $artist->_storage_ident_condition ], | ||
[ 1, { artistid => 1 }, { artistid => 1 } ], | ||
'Correct identity state of freshly retrieved object', | ||
); | ||
|
||
$artist->artistid(888); | ||
|
||
is_deeply( | ||
[ $artist->id, $artist->ident_condition, $artist->_storage_ident_condition ], | ||
[ 888, { artistid => 888 }, { artistid => 1 } ], | ||
'Correct identity state of object with modified PK', | ||
); | ||
|
||
$artist->update; | ||
|
||
is_deeply( | ||
[ $artist->id, $artist->ident_condition, $artist->_storage_ident_condition ], | ||
[ 888, { artistid => 888 }, { artistid => 888 } ], | ||
'Correct identity state after storage update', | ||
); | ||
|
||
done_testing; |