This repository has been archived on 2023-08-16. You can view files and clone it, but cannot push or open issues or pull requests.
Foodloop-Server/lib/Pear/LocalLoop/Import/Role/ExternalName.pm

20 lines
343 B
Perl
Raw Normal View History

2019-07-02 14:21:01 +00:00
package Pear::LocalLoop::Import::Role::ExternalName;
use strict;
use warnings;
use Moo::Role;
requires qw/
external_name
schema
/;
has external_result => (
is => 'lazy',
builder => sub {
my $self = shift;
2019-07-05 14:30:31 +00:00
return $self->schema->resultset('ExternalReference')->find_or_create({ name => $self->external_name });
2019-07-02 14:21:01 +00:00
}
);
2019-07-05 14:30:31 +00:00
1;