- 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
Небольшая утренняя ревизия кода раскрыла заговор по свержению власти и захвату мозга остальных кодеров проекта.
Сидим, рефакторим.
cheef 27.08.2009 11:30 # 0
eveel 27.08.2009 13:56 # 0
barop 27.01.2017 22:37 # 0
guest8 20.07.2020 13:35 # −999
guest 31.08.2009 11:01 # +0.8
eveel 01.09.2009 12:10 # +0.8
guest 08.12.2009 13:27 # 0
guest 15.03.2010 15:59 # 0
guest 15.03.2010 18:41 # +0.2
guest 27.01.2017 22:11 # 0