<commit_before>class RoomsController < ApplicationController
  respond_to :json
  def free_times
    rooms = Room.all
    start_date = Time.zone.parse(params[:startDate]).to_date
    end_date = Time.zone.parse(params[:endDate]).to_date
    hash = {}
    start_date.upto end_date do |date|
      time = Time.zone.parse(date.to_s)
      presenter = CalendarPresenter.cached(time.midnight, time.tomorrow.midnight)
      presenter.rooms.each do |room|
        hash[room.name] ||= {date.to_s => []}
        room.decorated_events(time).each do |event|
          if event.kind_of?(AvailableDecorator)
            hash[room.name][date.to_s] << {"start" => event.start_time.iso8601, "end" => event.end_time.iso8601}
          end
        end
      end
    end
    respond_with hash
  end
end<commit_msg>Added room image to free_times API.<commit_after>class RoomsController < ApplicationController
  respond_to :json
  def free_times
    rooms = Room.all
    start_date = Time.zone.parse(params[:startDate]).to_date
    end_date = Time.zone.parse(params[:endDate]).to_date
    hash = {}
    start_date.upto end_date do |date|
      time = Time.zone.parse(date.to_s)
      presenter = CalendarPresenter.cached(time.midnight, time.tomorrow.midnight)
      presenter.rooms.each do |room|
        hash[room.name] ||= {date.to_s => []}
        hash[room.name]["image"] = room.image.url unless room.image.blank?
        hash[room.name]["image"] ||= ""
        room.decorated_events(time).each do |event|
          if event.kind_of?(AvailableDecorator)
            hash[room.name][date.to_s] << {"start" => event.start_time.iso8601, "end" => event.end_time.iso8601}
          end
        end
      end
    end
    respond_with hash
  end
end
{'fraction_non_alphanumeric': 0.12521739130434784, 'fraction_numerical': 0.00927536231884058, 'mean_word_length': 2.931662870159453, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '109743', 'n_tokens_mistral': 580, 'n_tokens_neox': 571, 'n_words': 101}