Add the sequenceNumber property to Crud, and serialize it to the db. Tweak some tests for new code.
This commit is contained in:
parent
213a153b58
commit
447fe27d5f
2 changed files with 11 additions and 4 deletions
|
|
@ -42,6 +42,11 @@ has dateCreated => (
|
|||
builder => '_now',
|
||||
);
|
||||
|
||||
has sequenceNumber => (
|
||||
is => 'rw',
|
||||
default => 1,
|
||||
);
|
||||
|
||||
sub _now {
|
||||
my $self = shift;
|
||||
return WebGUI::DateTime->new($self->session)->toDatabase;
|
||||
|
|
@ -973,9 +978,10 @@ sub write {
|
|||
$data->{$property_name} = $value;
|
||||
}
|
||||
my $tableKey = $self->meta->tableKey;
|
||||
$data->{$tableKey} = $self->$tableKey;
|
||||
$data->{lastUpdated} = $self->lastUpdated;
|
||||
$data->{dateCreated} = $self->dateCreated;
|
||||
$data->{$tableKey} = $self->$tableKey;
|
||||
$data->{lastUpdated} = $self->lastUpdated;
|
||||
$data->{dateCreated} = $self->dateCreated;
|
||||
$data->{sequenceNumber} = $self->sequenceNumber;
|
||||
if (my $sequenceKey = $self->meta->sequenceKey) {
|
||||
$data->{$sequenceKey} = $self->$sequenceKey;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue