<commit_before># encoding: utf-8

class BaseModel < ActiveRecord::Base
  self.abstract_class = true

  include RepresentedModel

  def id_from_url(url)
    Rails.application.routes.recognize_path(url)[:id]
  end

  def update_file!(name)
    filename_will_change!
    raw_write_attribute(:filename, name)
    save!
  end
end<commit_msg>Add public_stories to the base model to use in series, networks, and accounts<commit_after># encoding: utf-8

class BaseModel < ActiveRecord::Base
  self.abstract_class = true

  include RepresentedModel

  def id_from_url(url)
    Rails.application.routes.recognize_path(url)[:id]
  end

  def update_file!(name)
    filename_will_change!
    raw_write_attribute(:filename, name)
    save!
  end

  def public_stories(arel=nil)
    Story.public_stories(arel || stories)
  end
end
{'fraction_non_alphanumeric': 0.0857843137254902, 'fraction_numerical': 0.0024509803921568627, 'mean_word_length': 4.483221476510067, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, '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': '6166407', 'n_tokens_mistral': 273, 'n_tokens_neox': 267, 'n_words': 60}