Skip to content

Commit 4e208b1

Browse files
committed
move find_changes_files from model to query
1 parent 3088767 commit 4e208b1

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

lib/MetaCPAN/Document/File/Set.pm

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ has query_file => (
1818
builder => '_build_query_file',
1919
handles => [ qw(
2020
dir
21+
find_changes_files
2122
interesting_files
2223
files_by_category
2324
) ],
@@ -412,13 +413,5 @@ sub autocomplete_suggester {
412413
};
413414
}
414415

415-
sub find_changes_files {
416-
my ( $self, $author, $release ) = @_;
417-
my $result = $self->files_by_category( $author, $release, ['changelog'],
418-
{ _source => true } );
419-
my ($file) = @{ $result->{categories}{changelog} || [] };
420-
return $file;
421-
}
422-
423416
__PACKAGE__->meta->make_immutable;
424417
1;

lib/MetaCPAN/Query/File.pm

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -348,5 +348,13 @@ sub files_by_category {
348348
return $return;
349349
}
350350

351+
sub find_changes_files {
352+
my ( $self, $author, $release ) = @_;
353+
my $result = $self->files_by_category( $author, $release, ['changelog'],
354+
{ _source => true } );
355+
my ($file) = @{ $result->{categories}{changelog} || [] };
356+
return $file;
357+
}
358+
351359
__PACKAGE__->meta->make_immutable;
352360
1;

0 commit comments

Comments
 (0)