<commit_before>class Webbastic::Page
  include DataMapper::Resource

  property :id, Serial
  property :name, String
  property :created_at, DateTime
  
  # Generated values are a stored text generated from 
  # the relationship with children objects
  property :generated_header, Text, :default => ""
  property :generated_content, Text, :default => ""
  
  belongs_to :site,         :class_name => Webbastic::Site,       :child_key => [:site_id]
  belongs_to :layout,       :class_name => Webbastic::Layout,     :child_key => [:layout_id]
  belongs_to :content_dir,  :class_name => Webbastic::ContentDir, :child_key => [:content_dir_id]
  
  has n, :headers,  :class_name => Webbastic::Header
  has n, :widgets,  :class_name => Webbastic::Widget
  
  # Force page generation on first time
  after :create, :create_defaults
  # after :update, :is_dirty
  
  # Delete page from filesystem
  before :destroy, :delete_page
  
  # =====
  #<commit_msg>Correct def name when page.destroy<commit_after>class Webbastic::Page
  include DataMapper::Resource

  property :id, Serial
  property :name, String
  property :created_at, DateTime
  
  # Generated values are a stored text generated from 
  # the relationship with children objects
  property :generated_header, Text, :default => ""
  property :generated_content, Text, :default => ""
  
  belongs_to :site,         :class_name => Webbastic::Site,       :child_key => [:site_id]
  belongs_to :layout,       :class_name => Webbastic::Layout,     :child_key => [:layout_id]
  belongs_to :content_dir,  :class_name => Webbastic::ContentDir, :child_key => [:content_dir_id]
  
  has n, :headers,  :class_name => Webbastic::Header
  has n, :widgets,  :class_name => Webbastic::Widget
  
  # Force page generation on first time
  after :create, :create_defaults
  # after :update, :is_dirty
  
  # Delete page from filesystem
  before :destroy, :delete_file
  
  # =====
  #
{'fraction_non_alphanumeric': 0.11307972902553413, 'fraction_numerical': 0.0, 'mean_word_length': 4.052631578947368, '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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4356873', 'n_tokens_mistral': 610, 'n_tokens_neox': 592, 'n_words': 166}