diff --git a/app/controllers/requests_controller.rb b/app/controllers/requests_controller.rb index 8c756875..98a9846e 100644 --- a/app/controllers/requests_controller.rb +++ b/app/controllers/requests_controller.rb @@ -228,11 +228,11 @@ def enough_resources? max_storage_host = hosts.max_by(&:free_storage_gb) - max_cpu_host_msg = "cores: #{max_cpu_host.cpu_cores}, ram: #{max_cpu_host.ram_gb / 1024}GB, hdd: #{max_cpu_host.storage_gb / 1024}GB" - max_ram_host_msg = "cores: #{max_ram_host.cpu_cores}, ram: #{max_ram_host.ram_gb / 1024}GB, hdd: #{max_ram_host.storage_gb / 1024}GB" - max_storage_host_msg = "cores: #{max_storage_host.cpu_cores}, ram: #{max_storage_host.ram_gb / 1024}GB, hdd: #{max_storage_host.storage_gb / 1024}GB" + max_cpu_host_msg = "cores: #{max_cpu_host.cpu_cores}, ram: #{max_cpu_host.ram_gb}GB, hdd: #{max_cpu_host.storage_gb}GB" + max_ram_host_msg = "cores: #{max_ram_host.cpu_cores}, ram: #{max_ram_host.ram_gb}GB, hdd: #{max_ram_host.storage_gb}GB" + max_storage_host_msg = "cores: #{max_storage_host.cpu_cores}, ram: #{max_storage_host.ram_gb}GB, hdd: #{max_storage_host.storage_gb}GB" - error_message = "Requested VM resources are too high! Most Powerful Hosts are: Max Core Host(#{max_cpu_host_msg}) Max RAM Host(#{max_ram_host_msg}) Max HDD Host(#{max_storage_host_msg}) " + error_message = "Requested VM resources are too high! Most Powerful Hosts are:\nMax CPU Cores Host(#{max_cpu_host_msg})\nMax RAM Host(#{max_ram_host_msg})\nMax HDD Host(#{max_storage_host_msg}) " @request.errors[:base] << error_message false end diff --git a/db/schema.rb b/db/schema.rb index 754508d5..05c37a42 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -126,16 +126,16 @@ t.datetime "remember_created_at" t.datetime "created_at", null: false t.datetime "updated_at", null: false + t.integer "role" t.integer "sign_in_count", default: 0, null: false t.datetime "current_sign_in_at" t.datetime "last_sign_in_at" t.string "current_sign_in_ip" t.string "last_sign_in_ip" - t.integer "role" - t.string "first_name" - t.string "last_name" t.string "provider" t.string "uid" + t.string "first_name" + t.string "last_name" t.integer "user_id" t.string "ssh_key" t.boolean "email_notifications", default: false