TT#154550 DBIx model vouchers - to_hash method

* to_hash() returns fields which includes the resolved inflated timestamps.

Change-Id: I6287f439108cde839ab5017ce4948d1783edf82a
mr10.4
Oleksandr Duts 3 years ago
parent 487a908c56
commit d2a825f2c7

@ -44,7 +44,7 @@ __PACKAGE__->add_columns(
extra => { unsigned => 1 },
is_foreign_key => 1,
is_nullable => 1,
},
},
"used_by_subscriber_id",
{
data_type => "integer",
@ -139,4 +139,15 @@ sub TO_JSON {
};
}
sub to_hash {
my $self = shift;
return (
$self->get_inflated_columns,
created_at => $self->get_column('created_at'),
used_at => $self->get_column('used_at'),
valid_until => $self->get_column('valid_until'),
);
}
1;

Loading…
Cancel
Save