app/helpers/repeating_events_helper.rb
def fetch_timeslots(time_slot_day,location)
    result = []
    timeslots = TimeSlot.all(conditions: ['start > ? and start < ? and location_id = ?',time_slot_day.beginning_of_day,time_slot_day.end_of_day,location.id])
    for timeslot in timeslots do
      if ((timeslot.start < timeslot.start.beginning_of_day + @dept_start_hour.hours) &&
         (timeslot.end    < timeslot.start.beginning_of_day + @dept_start_hour.hours)) ||
         ((timeslot.start > timeslot.start.beginning_of_day + @dept_end_hour.hours) &&
         (timeslot.end    > timeslot.start.beginning_of_day + @dept_end_hour.hours))
        @hidden_timeslots << timeslot
      else
        result << timeslot
      end
    end
    result
  end
#duplicated from time_slots helper, to fix things for the time being. TODO: cleanup.
duplicated from time_slots helper, to fix things for the time being. TODO: cleanup.
duplicated from time_slots helper to fix things for the time being . TODO : cleanup .
def fetch_timeslots(time_slot_day,location)
    result = []
    timeslots = TimeSlot.all(conditions: ['start > ? and start < ? and location_id = ?',time_slot_day.beginning_of_day,time_slot_day.end_of_day,location.id])
    for timeslot in timeslots do
      if ((timeslot.start < timeslot.start.beginning_of_day + @dept_start_hour.hours) &&
         (timeslot.end    < timeslot.start.beginning_of_day + @dept_start_hour.hours)) ||
         ((timeslot.start > timeslot.start.beginning_of_day + @dept_end_hour.hours) &&
         (timeslot.end    > timeslot.start.beginning_of_day + @dept_end_hour.hours))
        @hidden_timeslots << timeslot
      else
        result << timeslot
      end
    end
    result
  end
def fetch_timeslots ( time_slot_day , location ) result = [ ] timeslots = TimeSlot . all ( conditions : [ 'start > ? and start < ? and location_id = ?' , time_slot_day . beginning_of_day , time_slot_day . end_of_day , location . id ] ) for timeslot in timeslots do if ( ( timeslot . start < timeslot . start . beginning_of_day + @dept_start_hour . hours ) && ( timeslot . end < timeslot . start . beginning_of_day + @dept_start_hour . hours ) ) || ( ( timeslot . start > timeslot . start . beginning_of_day + @dept_end_hour . hours ) && ( timeslot . end > timeslot . start . beginning_of_day + @dept_end_hour . hours ) ) @hidden_timeslots << timeslot else result << timeslot end end result end
duplicated from time_slots helper, to fix things for the time being.
duplicated from time_slots helper to fix things for the time being .
time_slot_day
location