<commit_before>class Alerter::Preference < ActiveRecord::Base
  self.table_name = :alerter_preferences
  attr_accessible :alert_methods if Alerter.protected_attributes?

  belongs_to :notifiable, :polymorphic => :true
  belongs_to :notification_type

  validates :notification_type_id, uniqueness: { scope: :notifiable_id }
  validates_presence_of :notification_type_id

  before_validation do
    self.alert_methods.reject!{|x| x.blank?}
  end

  serialize :alert_methods, Array

  validate :alert_methods do
    unless self.methods.nil? || self.alert_methods.count == 0 || (self.alert_methods - Alerter::available_notification_methods).empty?
      errors.add(:alert_methods, "Must be only: #{Alerter::available_notification_methods.join(", ")}")
    end
  end



end<commit_msg>list on chosen app notification methods on an error<commit_after>class Alerter::Preference < ActiveRecord::Base
  self.table_name = :alerter_preferences
  attr_accessible :alert_methods if Alerter.protected_attributes?

  belongs_to :notifiable, :polymorphic => :true
  belongs_to :notification_type

  validates :notification_type_id, uniqueness: { scope: :notifiable_id }
  validates_presence_of :notification_type_id

  before_validation do
    self.alert_methods.reject!{|x| x.blank?}
  end

  serialize :alert_methods, Array

  validate :alert_methods do
    unless self.methods.nil? || self.alert_methods.count == 0 || (self.alert_methods - Alerter::available_notification_methods).empty?
      errors.add(:alert_methods, "Must be only: #{Alerter::notification_method.join(", ")}")
    end
  end



end
{'fraction_non_alphanumeric': 0.09943360604153556, 'fraction_numerical': 0.0012586532410320957, 'mean_word_length': 5.489795918367347, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '796421', 'n_tokens_mistral': 507, 'n_tokens_neox': 486, 'n_words': 101}