<commit_before>class NotificationMailer < ActionMailer::Base
  default from: "<EMAIL>"
  helper ApplicationHelper

  def lesson_notification(lesson_id, to_id, from_id)
    @lesson = Lesson.find(lesson_id)
    @user = User.find(to_id)
    from_user = User.find(from_id)
    subject = "Rails class #{@lesson.start_time.strftime("%-m/%-d")}: #{@lesson.title}"
    calendar = @lesson.to_ics
    attachments['calendar.ics'] = calendar if calendar.present?
    mail(:to => format_email_field(@user), :subject => subject,
         :from => format_email_field(from_user))
  end

  private
  def format_email_field(user)
    address = Mail::Address.new(user.email)
    address.display_name = user.name
    address.format
  end
end<commit_msg>Removes calendar's presence check in icalendar<commit_after>class NotificationMailer < ActionMailer::Base
  default from: "<EMAIL>"
  helper ApplicationHelper

  def lesson_notification(lesson_id, to_id, from_id)
    @lesson = Lesson.find(lesson_id)
    @user = User.find(to_id)
    from_user = User.find(from_id)
    subject = "Rails class #{@lesson.start_time.strftime("%-m/%-d")}: #{@lesson.title}"
    calendar = @lesson.to_ics
    attachments['calendar.ics'] = calendar
    mail(:to => format_email_field(@user), :subject => subject,
         :from => format_email_field(from_user))
  end

  private
  def format_email_field(user)
    address = Mail::Address.new(user.email)
    address.display_name = user.name
    address.format
  end
end
{'fraction_non_alphanumeric': 0.12787550744248985, 'fraction_numerical': 0.0, 'mean_word_length': 4.263345195729538, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 11, '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': '5880289', 'n_tokens_mistral': 498, 'n_tokens_neox': 488, 'n_words': 94}