<commit_before>class Reservation < ActiveRecord::Base

	belongs_to :user
	belongs_to :restaurant

  def update_times
    self.table_ready_time = self.created_at + 15.minutes
    self.notify_time = self.table_ready_time - 5.minutes
    self.save
  end

  def notify_now?
    get_diff <= 5
  end

  #run sidekiq if notify_now?



  private
    def get_diff
      self.notify_time - Time.now)/3600
    end
end
<commit_msg>added after save methods using update column<commit_after>class Reservation < ActiveRecord::Base
  after_save     :update_times
  # after_save
	belongs_to      :user
	belongs_to      :restaurant

  def update_times
    update_column(:table_ready_time, (self.created_at + 15.minutes))
    update_column(:notify_time, (self.table_ready_time - 5.minutes))
    update_column(:notified?, false)
    update_column(:table_ready, false)
  end

  def notify_now?
    get_diff <= 5 && self.notified? == false
  end

  #run sidekiq if notify_now?



  private
    def get_diff
      (self.notify_time - Time.now)/3600
    end
end

{'fraction_non_alphanumeric': 0.07996146435452794, 'fraction_numerical': 0.015414258188824663, 'mean_word_length': 3.3112033195020745, 'pattern_counts': {'":': 0, '<': 7, '<?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': '2996406', 'n_tokens_mistral': 377, 'n_tokens_neox': 345, 'n_words': 80}