<commit_before>class DevicesController < ApplicationController
  load_and_authorize_resource through: :current_user, singleton: true

  def show
    unless current_user.admin?
      @device = current_user.device
      @chart_data = {}
      @device.blood_sugars.each do |bs|
        @chart_data[bs.created_at] = bs.level
      end
    end
  end

end<commit_msg>fixed an admin checking device page in frontend<commit_after>class DevicesController < ApplicationController
  load_and_authorize_resource through: :current_user, singleton: true

  def show
    unless current_user.admin?
      @device = current_user.device
      @chart_data = {}
      @device.blood_sugars.each do |bs|
        @chart_data[bs.created_at] = bs.level
      end
    else
      recirect_to root_path, notice: 'admin cant look at a device'
    end
  end

end
{'fraction_non_alphanumeric': 0.07211538461538461, 'fraction_numerical': 0.0, 'mean_word_length': 3.3385416666666665, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, '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': '1782394', 'n_tokens_mistral': 262, 'n_tokens_neox': 251, 'n_words': 64}