<commit_before>module Setup
  class DelayedMessage
    include CenitUnscoped

    deny :all

    build_in_data_type

    field :message, type: String
    field :publish_at, type: DateTime
    field :unscheduled, type: Boolean

    belongs_to :scheduler, class_name: Setup::Scheduler.to_s, inverse_of: :delayed_messages
    belongs_to :tenant, class_name: Account.to_s, inverse_of: nil

    validates_presence_of :message

    before_save do
      self.tenant ||= Tenant.current
      unless publish_at.present?
        self.publish_at =
          if (n_time = (scheduler&.next_time))
            n_time
          else
            if scheduler
              nil
            else
              self.class.default_publish_at
            end<commit_msg>Update | Delayed message config<commit_after>module Setup
  class DelayedMessage
    include CenitUnscoped

    deny :all

    build_in_data_type.and(
      properties: {
        live_publish_at: {
          type: 'string',
          format: 'date-time'
        }
      }
    )

    field :message, type: String
    field :publish_at, type: DateTime
    field :unscheduled, type: Boolean

    belongs_to :scheduler, class_name: Setup::Scheduler.to_s, inverse_of: :delayed_messages
    belongs_to :tenant, class_name: Account.to_s, inverse_of: nil

    validates_presence_of :message

    before_save do
      self.tenant ||= Tenant.current
      unless publish_at.present?
        self.publish_at =
          if (n_time = (scheduler&.next_time))
            n_time
          else
            if scheduler
              nil
            else
              self.class.default_publish_at
            end
{'fraction_non_alphanumeric': 0.06796116504854369, 'fraction_numerical': 0.0, 'mean_word_length': 2.134980988593156, 'pattern_counts': {'":': 0, '<': 3, '<?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': '5267824', 'n_tokens_mistral': 499, 'n_tokens_neox': 495, 'n_words': 114}