<commit_before>ActionDispatch::Callbacks.to_prepare do
  Site.acts_as_role_context
  Section.acts_as_role_context :parent => :site
  Content.acts_as_role_context :parent => :section
  # Comment.acts_as_role_context :parent => :commentable

  # CalendarEvent.acts_as_role_context :parent => :section  if Rails.plugin?(:adva_calendar)
  # Photo.acts_as_role_context :parent => :section          if Rails.plugin?(:adva_photos)

  # if Rails.plugin?(:adva_forum)
  #   Board.acts_as_role_context :parent => :section
  #   Topic.acts_as_role_context :parent => :section
  # end

  Rbac::Role.class_eval do
    belongs_to :ancestor_context, :polymorphic => true

    before_save do |role|
      role.ancestor_context = role.context.owners.detect do |context|
        context.is_a?(Site) || context.is_a?(Account)<commit_msg>apparently this needs to be there.<commit_after>ActionDispatch::Callbacks.to_prepare do
  Site.acts_as_role_context
  Section.acts_as_role_context :parent => :site
  Category.acts_as_role_context :parent => :section
  Content.acts_as_role_context :parent => :section
  # Comment.acts_as_role_context :parent => :commentable

  # CalendarEvent.acts_as_role_context :parent => :section  if Rails.plugin?(:adva_calendar)
  # Photo.acts_as_role_context :parent => :section          if Rails.plugin?(:adva_photos)

  # if Rails.plugin?(:adva_forum)
  #   Board.acts_as_role_context :parent => :section
  #   Topic.acts_as_role_context :parent => :section
  # end

  Rbac::Role.class_eval do
    belongs_to :ancestor_context, :polymorphic => true

    before_save do |role|
      role.ancestor_context = role.context.owners.detect do |context|
        context.is_a?(Site) || context.is_a?(Account)
{'fraction_non_alphanumeric': 0.11000585137507314, 'fraction_numerical': 0.0, 'mean_word_length': 4.7, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 20, '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': '6703086', 'n_tokens_mistral': 589, 'n_tokens_neox': 567, 'n_words': 99}