# frozen_string_literal: true

# Test controller only admin access
class TestController < ApplicationController
  def add_locations
    return unless Location.all.blank?

    Location.create(parent_id: nil, name: 'Cała polska')
    Location.create(parent_id: 1, name: 'dolnośląskie')
    Location.create(parent_id: 1, name: 'kujawsko-pomorskie')
    Location.create(parent_id: 1, name: 'lubelskie')
    Location.create(parent_id: 1, name: 'lubuskie')
    Location.create(parent_id: 1, name: 'łódzkie')
    Location.create(parent_id: 1, name: 'małopolskie')
    Location.create(parent_id: 1, name: 'mazowieckie')
    Location.create(parent_id: 1, name: 'opolskie')
    Location.create(parent_id: 1, name: 'podkarpackie')
    Location.create(parent_id: 1, name: 'podlaskie')
    Location.create(parent_id: 1, name: 'pomorskie')
    Location.create(parent_id: 1, name: 'śląskie')
    Location.create(parent_id: 1, name: 'świętokrzyskie')
    Location.create(parent_id: 1, name: 'warmińsko-mazurskie')
    Location.create(parent_id: 1, name: 'wielkopolskie')
    Location.create(parent_id: 1, name: 'zachodniopomorskie')
  end
end
