<commit_before>class Feedback < ApplicationRecord
  default_scope { where(is_invalidated: false, is_ignored: false) }
  scope :ignored, where(:is_ignored => true)
  scope :invalid, where(:is_invalidated => true)

  belongs_to :post
  belongs_to :user
  after_save :update_post_feedback_cache

  after_create do
    ActionCable.server.broadcast "posts_#{self.post_id}", { feedback: FeedbacksController.render(locals: {feedback: self}, partial: 'feedback').html_safe }
  end

  def is_positive?
    self.feedback_type.include? "t"<commit_msg>methodify scopes to avoid default<commit_after>class Feedback < ApplicationRecord
  default_scope { where(is_invalidated: false, is_ignored: false) }

  def self.ignored
    self.unscoped.where(:is_ignored => true)
  end

  def self.invalid
    self.unscoped.where(:is_invalid => true)
  end

  belongs_to :post
  belongs_to :user
  after_save :update_post_feedback_cache

  after_create do
    ActionCable.server.broadcast "posts_#{self.post_id}", { feedback: FeedbacksController.render(locals: {feedback: self}, partial: 'feedback').html_safe }
  end

  def is_positive?
    self.feedback_type.include? "t"
{'fraction_non_alphanumeric': 0.10278745644599303, 'fraction_numerical': 0.0, 'mean_word_length': 5.210810810810811, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, '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': '2093324', 'n_tokens_mistral': 390, 'n_tokens_neox': 373, 'n_words': 79}