- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
@ids.each_index do |di|
if @ids[di] then
@ids[di].each_index do |li|
@employ[di][li] = Hash.new
@employ[di][li][:subject] = Subject.find(:first, :conditions => "id = #{
Lesson.find(:first, :conditions => "id = #{@ids[di][li]}")[:subject_id]
}")[:title] if @ids[di][li]
@employ[di][li][:class] = SchoolClass.find(:first, :conditions => "id = #{
Lesson.find(:first, :conditions => "id = #{@ids[di][li]}")[:school_class_id]
}")[:number].to_s +
SchoolClass.find(:first, :conditions => "id = #{
Lesson.find(:first, :conditions => "id = #{@ids[di][li]}")[:school_class_id]
}")[:letter] if @ids[di][li]
@employ[di][li][:teacher] = Teacher.find(:first, :conditions => "id = #{
Lesson.find(:first, :conditions => "id = #{@ids[di][li]}")[:teacher_id]
}")[:name] + ' ' +
@employ[di][li][:teacher] = Teacher.find(:first, :conditions => "id = #{
Lesson.find(:first, :conditions => "id = #{@ids[di][li]}")[:teacher_id]
}")[:surname] + ' ' +
@employ[di][li][:teacher] = Teacher.find(:first, :conditions => "id = #{
Lesson.find(:first, :conditions => "id = #{@ids[di][li]}")[:teacher_id]
}")[:patronymic] if @ids[di][li]
end
end
end
Небольшая утренняя ревизия кода раскрыла заговор по свержению власти и захвату мозга остальных кодеров проекта.
Сидим, рефакторим.