app/controllers/lectures_controller.rb
# creating new lecture as assoc_target of a course
creating new lecture as assoc_target of a course
creating new lecture as assoc_target of a course
def prepare_for_adding_assoc_target(lecture, pre_assoc_items)
    @def_lecture_form_items = Def_Lecture_Form_Items
    @lecture_form_items     = Lecture_Form_Items
    @def_lecture_time_form_items = Def_Lecture_Time_Form_Items
    @lecture_time_form_items     = Lecture_Time_Form_Items
    @course = find_entity(pre_assoc_items[-2])
    flash_now @course.blank?, "連結する科目がまだ作られていません．それを作成後，あらためて授業の作成を行ってください．"
    arrange_environment_from_background
    set_assert_time_as_end_of_academic_season_range
    @default_since = beginning_of_academic_season(@academic_year, @academic_season)
    unless @course.blank?
      lecture.build_course(@course)
      @course.since = @root_entity_since
      @course.course_classes.reject(&:new_record?).map do |cc| 
        lecture.lecture_course_classes.build(:course_class_run_id => cc.run_id)
      end
      @course_classes = @course.course_classes
    end
    @default_since = beginning_of_academic_season
    lecture.since = @root_entity_since
    lecture.lecture_member__teachers.build
    lecture.lecture_times.build
  end
def prepare_for_adding_assoc_target ( lecture , pre_assoc_items ) @def_lecture_form_items = Def_Lecture_Form_Items @lecture_form_items = Lecture_Form_Items @def_lecture_time_form_items = Def_Lecture_Time_Form_Items @lecture_time_form_items = Lecture_Time_Form_Items @course = find_entity ( pre_assoc_items [ - 2 ] ) flash_now @course . blank? , "連結する科目がまだ作られていません．それを作成後，あらためて授業の作成を行ってください．" arrange_environment_from_background set_assert_time_as_end_of_academic_season_range @default_since = beginning_of_academic_season ( @academic_year , @academic_season ) unless @course . blank? lecture . build_course ( @course ) @course . since = @root_entity_since @course . course_classes . reject ( & :new_record? ) . map do | cc | lecture . lecture_course_classes . build ( :course_class_run_id => cc . run_id ) end @course_classes = @course . course_classes end @default_since = beginning_of_academic_season lecture . since = @root_entity_since lecture . lecture_member__teachers . build lecture . lecture_times . build end
creating new lecture as assoc_target of a course
creating new lecture as assoc_target of a course
# default since through whole composite entity
lecture
<not_specific>
pre_assoc_items
<not_specific>