Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def method(x)
- x.split( doesn't matter what the args are )
- end
- def method(x)
- x.gsub( doesn't matter what the args are )
- end
- students.each do |student|
- cloned_student = student.clone
- ...
- cloned_student.books.detect {...}
- ca_teachers = cloned_student.teachers.detect {|teacher| teacher.address.state == 'CA'}
- ca_teachers.blah_blah
- ...
- # Not sure if the following is necessary, but we have it just in case...
- cloned_student = nil
- end
- students.each do |student|
- loop_student = Student.find(student.id) # just re-find the record into local variable.
- ...
- loop_student.books.detect {...}
- ca_teachers = loop_student.teachers.detect {|teacher| teacher.address.state == 'CA'}
- ca_teachers.blah_blah
- ...
- end
Add Comment
Please, Sign In to add comment