<commit_before>class LessonPlanEntriesController < ApplicationController
  load_and_authorize_resource :course
  load_and_authorize_resource :lesson_plan_entry, through: :course

  before_filter :load_general_course_data, :only => [:index]
  before_filter :specify_course_id, :only => [:new, :edit]

  def specify_course_id
    gon.course = @course.id
  end

  def index
    @milestones = @course.lesson_plan_milestones.all

    # Add the entries which don't belong in any milestone
    other_entries = if @milestones.length > 0 then
        from = @milestones[@milestones.length - 1].end_at
        @course.lesson_plan_entries.where("end_at > :end_at",
          :end_at => from) +
        @course.lesson_plan_virtual_entries(from)
      else
        @course.lesson_plan_entries.all +<commit_msg>Fix ordering of milestones to ensure the correct set of lesson plan entries are displayed as without any milestone.<commit_after>class LessonPlanEntriesController < ApplicationController
  load_and_authorize_resource :course
  load_and_authorize_resource :lesson_plan_entry, through: :course

  before_filter :load_general_course_data, :only => [:index]
  before_filter :specify_course_id, :only => [:new, :edit]

  def specify_course_id
    gon.course = @course.id
  end

  def index
    @milestones = @course.lesson_plan_milestones.order("end_at")

    # Add the entries which don't belong in any milestone
    other_entries = if @milestones.length > 0 then
        from = @milestones[@milestones.length - 1].end_at
        @course.lesson_plan_entries.where("end_at > :end_at",
          :end_at => from) +
        @course.lesson_plan_virtual_entries(from)
      else
        @course.lesson_plan_entries.all +
{'fraction_non_alphanumeric': 0.08723653395784543, 'fraction_numerical': 0.00234192037470726, 'mean_word_length': 4.056213017751479, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 13, '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': '6809032', 'n_tokens_mistral': 555, 'n_tokens_neox': 524, 'n_words': 120}