<commit_before>class Lecture < ApplicationRecord
  include CourseLock

  validates_presence_of :date, :time_from, :time_to, :summary
  validates :summary, uniqueness: { scope: :course_id }

  default_scope { order(date: :asc) }
  scope :required, -> { where(required: true) }
  scope :past_and_current, -> { where("date < ?", Time.zone.now.end_of_day) }

  def self.current
    where("date between ? and ?", Time.new.beginning_of_day, Time.new.end_of_day).first
  end

  def current?
    now = Time.new.utc
    if time_from.present? && time_to.present?
      date_from = date + time_from.hour.hours + time_from.min.minutes - 30.minutes<commit_msg>Fixed attendance<commit_after>class Lecture < ApplicationRecord
  include CourseLock

  validates_presence_of :date, :time_from, :time_to, :summary
  validates :summary, uniqueness: { scope: :course_id }

  default_scope { order(date: :asc) }
  scope :required, -> { where(required: true) }
  scope :past_and_current, -> { where("date < ?", Time.zone.now.end_of_day) }

  def self.current
    where("date between ? and ?", Time.zone.now.beginning_of_day, Time.zone.now.end_of_day).first
  end

  def current?
    now = Time.zone.now
    if time_from.present? && time_to.present?
      date_from = date + time_from.hour.hours + time_from.min.minutes - 30.minutes
{'fraction_non_alphanumeric': 0.12691131498470948, 'fraction_numerical': 0.0030581039755351682, 'mean_word_length': 4.073643410852713, 'pattern_counts': {'":': 0, '<': 7, '<?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': '6678915', 'n_tokens_mistral': 467, 'n_tokens_neox': 440, 'n_words': 92}