Displaying 1 result from an estimated 1 matches for "contract2_schedul".
Did you mean:
contract12_schedule
2007 Sep 06
2
HABTM Loops
...am: *****
2:00 am: ******
3:00 am: ******
etc..
How can I create a loop that can replace my extremely un-DRY queries
in my controller?
# Controller #######################
@contract1_schedules = Hour.find(1).schedules.find(:all, :conditions
=> "week = ''#{@woy}''")
@contract2_schedules = Hour.find(2).schedules.find(:all, :conditions
=> "week = ''#{@woy}''")
@contract3_schedules = Hour.find(3).schedules.find(:all, :conditions
=> "week = ''#{@woy}''")
@contract4_schedules = Hour.find(4).schedules.find(:all, :conditions
=&g...