diff options
author | Matthew Somerville <matthew-github@dracos.co.uk> | 2016-07-19 22:54:14 +0100 |
---|---|---|
committer | Dave Arter <davea@mysociety.org> | 2016-08-01 11:51:38 +0100 |
commit | 8699a41fbeb79816d9852a2d1231ebd690cdd0ba (patch) | |
tree | 2e0e3878136f9c5b29c07d5fc2fc9ae0ec8ac643 /perllib/FixMyStreet/DB/Result/Comment.pm | |
parent | d8af894ea2fdc41f03b96220b8f7510eb54ce686 (diff) |
Move photoset stuff to new Role.
Diffstat (limited to 'perllib/FixMyStreet/DB/Result/Comment.pm')
-rw-r--r-- | perllib/FixMyStreet/DB/Result/Comment.pm | 23 |
1 files changed, 2 insertions, 21 deletions
diff --git a/perllib/FixMyStreet/DB/Result/Comment.pm b/perllib/FixMyStreet/DB/Result/Comment.pm index 85cdb29f0..25798edca 100644 --- a/perllib/FixMyStreet/DB/Result/Comment.pm +++ b/perllib/FixMyStreet/DB/Result/Comment.pm @@ -99,7 +99,8 @@ __PACKAGE__->rabx_column('extra'); use Moo; use namespace::clean -except => [ 'meta' ]; -with 'FixMyStreet::Roles::Abuser'; +with 'FixMyStreet::Roles::Abuser', + 'FixMyStreet::Roles::PhotoSet'; my $stz = sub { my ( $orig, $self ) = ( shift, shift ); @@ -147,26 +148,6 @@ sub confirm { $self->confirmed( \'current_timestamp' ); } -=head2 get_photoset - -Return a PhotoSet object for all photos attached to this field - - my $photoset = $obj->get_photoset; - print $photoset->num_images; - return $photoset->get_image_data(num => 0, size => 'full'); - -=cut - -sub get_photoset { - my ($self) = @_; - my $class = 'FixMyStreet::App::Model::PhotoSet'; - eval "use $class"; - return $class->new({ - db_data => $self->photo, - object => $self, - }); -} - sub photos { my $self = shift; my $photoset = $self->get_photoset; |