| 1 | package App::SD::Model::Comment; | ||
| 2 | use Any::Moose; | ||
| 3 | extends 'App::SD::Record'; | ||
| 4 | |||
| 5 | use constant collection_class => 'App::SD::Collection::Comment'; | ||
| 6 | has '+type' => ( default => 'comment'); | ||
| 7 | |||
| 8 | |||
| 9 | sub _default_summary_format { '%s,$uuid | %s,content'} | ||
| 10 | |||
| 11 | sub declared_props { return ('content', shift->SUPER::declared_props(@_)) } | ||
| 12 | |||
| 13 | sub canonicalize_props { | ||
| 14 | my $self = shift; | ||
| 15 | my $props = shift; | ||
| 16 | $self->SUPER::canonicalize_props($props); | ||
| 17 | |||
| 18 | unless ($props->{content}) { | ||
| 19 | delete $props->{$_} for keys %$props; | ||
| 20 | } | ||
| 21 | } | ||
| 22 | |||
| 23 | |||
| 24 | #has SVK::Model::Ticket; | ||
| 25 | |||
| 26 | __PACKAGE__->register_reference( ticket => 'App::SD::Model::Ticket'); | ||
| 27 | |||
| 28 | __PACKAGE__->meta->make_immutable; | ||
| 29 | no Any::Moose; | ||
| 30 | 1; |