<commit_before>package EnsEMBL::ORM::Rose::Object::HelpRecord;

### NAME: EnsEMBL::ORM::Rose::Object::HelpRecord
### ORM class for the help_record table in ensembl_website

### STATUS: Stable 

use strict;
use warnings;

use base qw(EnsEMBL::ORM::Rose::Object::Trackable);

use constant ROSE_DB_NAME => 'website';

## Define schema
__PACKAGE__->meta->setup(
  table       => 'help_record',

  columns     => [
    help_record_id => {type => 'serial',                    not_null => 1, primary_key => 1},
    type           => {type => 'varchar',  'length' => 255, not_null => 1},
    keyword        => {type => 'text'},
    data           => {type => 'datamap',  'trusted' => 1,  not_null => 1, 'keys' => [qw(question answer category word expanded meaning list_position length youtube_id title ensembl_object ensembl_action content)]},
    status         => {type => 'enum',     'values' => [qw(draft live dead)] },
    helpful        => {type => 'int',      'length' => 11},
    not_helpful    => {type => 'int',      'length' => 11}
  ]
);

1;<commit_msg>help_links relation added; include_in_lookup customised<commit_after>package EnsEMBL::ORM::Rose::Object::HelpRecord;

### NAME: EnsEMBL::ORM::Rose::Object::HelpRecord
### ORM class for the help_record table in ensembl_website

### STATUS: Stable 

use strict;
use warnings;

use base qw(EnsEMBL::ORM::Rose::Object::Trackable);

use constant ROSE_DB_NAME => 'website';

## Define schema
__PACKAGE__->meta->setup(
  table         => 'help_record',

  columns       => [
    help_record_id  => {type => 'serial',                    not_null => 1, primary_key => 1},
    type            => {type => 'varchar',  'length' => 255, not_null => 1},
    keyword         => {type => 'text'},
    data            => {type => 'datamap',  'trusted' => 1,  not_null => 1, 'keys' => [qw(question answer category word expanded meaning list_position length youtube_id title ensembl_object ensembl_action content)]},
    status          => {type => 'enum',     'values' => [qw(draft live dead)] },
    helpful         => {type => 'int',      'length' => 11},
    not_helpful     => {type => 'int',      'length' => 11}
  ],
  
  title_column  => 'data.content', # for help pages only - ie. if help_record.type == 'view'

  relationships => [
    help_links      => {  # this relation only exists if help_record.type == 'view'
      'type'          => 'one to many',
      'class'         => 'EnsEMBL::ORM::Rose::Object::HelpLink',
      'column_map'    => {'help_record_id' => 'help_record_id'},
    }
  ]
);

sub include_in_lookup {
  ## @overrides
  ## Only help_record with type == 'view' can can be used, as only relationship that 
  return (shift->column_value('type') || '') eq 'view';
}

1;
{'fraction_non_alphanumeric': 0.16526508226691042, 'fraction_numerical': 0.009506398537477149, 'mean_word_length': 3.0353982300884956, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 69, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5894817', 'n_tokens_mistral': 926, 'n_tokens_neox': 870, 'n_words': 225}