<commit_before>package EnsEMBL::ORM::Data::Rose::Changelog;

### NAME: EnsEMBL::ORM::Data::Rose::Changelog;

### STATUS: Under Development

### DESCRIPTION:

use strict;
use warnings;
no warnings qw(uninitialized);

use EnsEMBL::ORM::Rose::Manager::Changelog;
use base qw(EnsEMBL::ORM::Data::Rose);

sub set_primary_keys {
  my $self = shift;
  $self->{'_primary_keys'} = [qw(changelog_id)];
}

sub fetch_all {
  my $self = shift;

  my $objects = EnsEMBL::ORM::Rose::Manager::Changelog->get_changelogs(
    query => [
      release_id => $self->hub->species_defs->ENSEMBL_VERSION,
    ],
    sort_by => 'team',
  );
  $self->data_objects(@$objects);
  return $objects;
}

1;<commit_msg>Added more documentation and extended functionality of fetch_all<commit_after>package EnsEMBL::ORM::Data::Rose::Changelog;

### NAME: EnsEMBL::ORM::Data::Rose::Changelog;
### Wrapper for one or more EnsEMBL::ORM::Rose::Object::Changelog objects

### STATUS: Under Development

### DESCRIPTION:

use strict;
use warnings;
no warnings qw(uninitialized);

use EnsEMBL::ORM::Rose::Manager::Changelog;
use base qw(EnsEMBL::ORM::Data::Rose);

sub set_primary_keys {
  my $self = shift;
  $self->{'_primary_keys'} = [qw(changelog_id)];
}

sub fetch_all {
### Custom query - for the changelog output, we normally only want to 
## see the results for one release at a time
  my $self = shift;
  my $release_id = $self->hub->param('release') 
                      || $self->hub->species_defs->ENSEMBL_VERSION;

  my $objects = EnsEMBL::ORM::Rose::Manager::Changelog->get_changelogs(
    query => [
      release_id => $release_id,
    ],
    sort_by => 'team',
  );
  $self->data_objects(@$objects);
  return $objects;
}

1;
{'fraction_non_alphanumeric': 0.1662749706227967, 'fraction_numerical': 0.0011750881316098707, 'mean_word_length': 4.913194444444445, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 23, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6193757', 'n_tokens_mistral': 643, 'n_tokens_neox': 598, 'n_words': 125}