diff --git a/app/controllers/vouchers_controller.rb b/app/controllers/vouchers_controller.rb index 1474407..debc1ed 100644 --- a/app/controllers/vouchers_controller.rb +++ b/app/controllers/vouchers_controller.rb @@ -5,6 +5,8 @@ class VouchersController < ApplicationController # GET /vouchers def index @vouchers = Voucher.all + whitelist = `mcrcon -H mine.vereto.net -p #{ENV["MC_RCON_PASS"]} 'whitelist list' | sed 's/There are*.*whitelisted players: //g'`.split(", ") + @vouchers.zip(whitelist) render json: @vouchers end @@ -18,20 +20,21 @@ class VouchersController < ApplicationController def create # Logic for creating a voucher output = "" - whitelist = `mcrcon -H mine.vereto.net -p #{ENV["MC_RCON_PASS"]} "whitelist list" | sed 's/There are*.*whitelisted players: //g'`.split(", ") + whitelist = `mcrcon -H mine.vereto.net -p #{ENV["MC_RCON_PASS"]} "whitelist list" | sed 's/There are*.*whitelisted players: //g'`.gsub('', "").gsub("\n", "") + whitelist = whitelist.split(", ") if Voucher.exists?(vouchee: params[:voucher]) && params[:voucher].in?(whitelist) @voucher = Voucher.new(voucher_params) if @voucher.save output = `mcrcon -H mine.vereto.net -p #{ENV["MC_RCON_PASS"]} "whitelist add #{params[:vouchee]}"` - render json: output, status: :created, location: @voucher + render json: { :message => output }.to_json, status: :created, location: @voucher else render json: @voucher.errors, status: :unprocessable_entity end else - render json: "Voucher is not valid. Whitelisted: " + params[:voucher].in?(whitelist).to_s + ". Exists: " + Voucher.exists?(vouchee: params[:voucher]).to_s + ". " + whitelist.to_s, status: :unprocessable_entity + render json: { :message => "Voucher is not valid.", :whitelisted => params[:voucher].in?(whitelist), :exists => Voucher.exists?(vouchee: params[:voucher]), :list => whitelist }.to_json, status: :unprocessable_entity end diff --git a/log/development.log b/log/development.log index 20c8e8f..5ee55c2 100644 --- a/log/development.log +++ b/log/development.log @@ -1939,3 +1939,363 @@ Processing by VouchersController#create as HTML Completed 422 Unprocessable Entity in 132ms (Views: 0.2ms | ActiveRecord: 2.1ms | Allocations: 1850) +Started POST "/vouchers?voucher=PromoStarr&vouchee=Scootzaar&accepted=true" for ::1 at 2019-10-08 20:23:48 +0200 +  (0.2ms) SET @@SESSION.sql_mode = CONCAT(CONCAT(@@sql_mode, ',STRICT_ALL_TABLES'), ',NO_AUTO_VALUE_ON_ZERO'), @@SESSION.sql_auto_is_null = 0, @@SESSION.wait_timeout = 2147483 +  (0.2ms) SELECT `schema_migrations`.`version` FROM `schema_migrations` ORDER BY `schema_migrations`.`version` ASC +Processing by VouchersController#create as HTML + Parameters: {"voucher"=>"PromoStarr", "vouchee"=>"Scootzaar", "accepted"=>"true"} + Voucher Exists? (0.3ms) SELECT 1 AS one FROM `vouchers` WHERE `vouchers`.`vouchee` = 'PromoStarr' LIMIT 1 + ↳ app/controllers/vouchers_controller.rb:25:in `create' + CACHE Voucher Exists? (0.0ms) SELECT 1 AS one FROM `vouchers` WHERE `vouchers`.`vouchee` = 'PromoStarr' LIMIT 1 + ↳ app/controllers/vouchers_controller.rb:36:in `create' +Completed 422 Unprocessable Entity in 100ms (Views: 0.2ms | ActiveRecord: 1.0ms | Allocations: 2375) + + +Started GET "/vouchers" for ::1 at 2019-10-08 20:24:01 +0200 +Processing by VouchersController#index as */* + Voucher Load (0.3ms) SELECT `vouchers`.* FROM `vouchers` + ↳ app/controllers/vouchers_controller.rb:9:in `zip' +Completed 200 OK in 86ms (Views: 0.2ms | ActiveRecord: 0.3ms | Allocations: 718) + + +Started POST "/vouchers?voucher=PromoStarr&vouchee=Scootzaar" for ::1 at 2019-10-08 20:24:11 +0200 +Processing by VouchersController#create as HTML + Parameters: {"voucher"=>"PromoStarr", "vouchee"=>"Scootzaar"} + Voucher Exists? (0.5ms) SELECT 1 AS one FROM `vouchers` WHERE `vouchers`.`vouchee` = 'PromoStarr' LIMIT 1 + ↳ app/controllers/vouchers_controller.rb:25:in `create' + CACHE Voucher Exists? (0.0ms) SELECT 1 AS one FROM `vouchers` WHERE `vouchers`.`vouchee` = 'PromoStarr' LIMIT 1 + ↳ app/controllers/vouchers_controller.rb:36:in `create' +Completed 422 Unprocessable Entity in 98ms (Views: 0.2ms | ActiveRecord: 0.5ms | Allocations: 1270) + + +Started POST "/vouchers?voucher=PromoStarr&vouchee=Scootzaar" for ::1 at 2019-10-08 20:25:14 +0200 +Processing by VouchersController#create as HTML + Parameters: {"voucher"=>"PromoStarr", "vouchee"=>"Scootzaar"} + Voucher Exists? (0.3ms) SELECT 1 AS one FROM `vouchers` WHERE `vouchers`.`vouchee` = 'PromoStarr' LIMIT 1 + ↳ app/controllers/vouchers_controller.rb:25:in `create' + CACHE Voucher Exists? (0.0ms) SELECT 1 AS one FROM `vouchers` WHERE `vouchers`.`vouchee` = 'PromoStarr' LIMIT 1 + ↳ app/controllers/vouchers_controller.rb:36:in `create' +Completed 422 Unprocessable Entity in 117ms (Views: 0.1ms | ActiveRecord: 0.3ms | Allocations: 1253) + + +Started POST "/vouchers?voucher=PromoStarr&vouchee=Scootzaar" for ::1 at 2019-10-08 20:25:42 +0200 +Processing by VouchersController#create as HTML + Parameters: {"voucher"=>"PromoStarr", "vouchee"=>"Scootzaar"} + Voucher Exists? (0.2ms) SELECT 1 AS one FROM `vouchers` WHERE `vouchers`.`vouchee` = 'PromoStarr' LIMIT 1 + ↳ app/controllers/vouchers_controller.rb:25:in `create' + CACHE Voucher Exists? (0.0ms) SELECT 1 AS one FROM `vouchers` WHERE `vouchers`.`vouchee` = 'PromoStarr' LIMIT 1 + ↳ app/controllers/vouchers_controller.rb:36:in `create' +Completed 422 Unprocessable Entity in 81ms (Views: 0.1ms | ActiveRecord: 0.8ms | Allocations: 1743) + + +Started POST "/vouchers?voucher=PromoStarr&vouchee=Scootzaar" for ::1 at 2019-10-08 20:26:29 +0200 +  (0.2ms) SET @@SESSION.sql_mode = CONCAT(CONCAT(@@sql_mode, ',STRICT_ALL_TABLES'), ',NO_AUTO_VALUE_ON_ZERO'), @@SESSION.sql_auto_is_null = 0, @@SESSION.wait_timeout = 2147483 +  (0.2ms) SELECT `schema_migrations`.`version` FROM `schema_migrations` ORDER BY `schema_migrations`.`version` ASC +Processing by VouchersController#create as HTML + Parameters: {"voucher"=>"PromoStarr", "vouchee"=>"Scootzaar"} + Voucher Exists? (0.2ms) SELECT 1 AS one FROM `vouchers` WHERE `vouchers`.`vouchee` = 'PromoStarr' LIMIT 1 + ↳ app/controllers/vouchers_controller.rb:25:in `create' + CACHE Voucher Exists? (0.0ms) SELECT 1 AS one FROM `vouchers` WHERE `vouchers`.`vouchee` = 'PromoStarr' LIMIT 1 + ↳ app/controllers/vouchers_controller.rb:36:in `create' +Completed 422 Unprocessable Entity in 101ms (Views: 0.1ms | ActiveRecord: 0.6ms | Allocations: 2392) + + +Started POST "/vouchers?voucher=PromoStarr&vouchee=Scootzaar" for ::1 at 2019-10-08 21:31:22 +0200 +  (0.2ms) SET @@SESSION.sql_mode = CONCAT(CONCAT(@@sql_mode, ',STRICT_ALL_TABLES'), ',NO_AUTO_VALUE_ON_ZERO'), @@SESSION.sql_auto_is_null = 0, @@SESSION.wait_timeout = 2147483 +  (0.1ms) SELECT `schema_migrations`.`version` FROM `schema_migrations` ORDER BY `schema_migrations`.`version` ASC +Processing by VouchersController#create as HTML + Parameters: {"voucher"=>"PromoStarr", "vouchee"=>"Scootzaar"} +Completed 500 Internal Server Error in 107ms (ActiveRecord: 0.0ms | Allocations: 199) + + + +ArgumentError (wrong number of arguments (given 1, expected 2)): + +app/controllers/vouchers_controller.rb:23:in `sub!' +app/controllers/vouchers_controller.rb:23:in `create' +Started POST "/vouchers?voucher=PromoStarr&vouchee=Scootzaar" for ::1 at 2019-10-08 21:31:37 +0200 +Processing by VouchersController#create as HTML + Parameters: {"voucher"=>"PromoStarr", "vouchee"=>"Scootzaar"} +Completed 500 Internal Server Error in 111ms (ActiveRecord: 0.0ms | Allocations: 187) + + + +NoMethodError (undefined method `split' for nil:NilClass): + +app/controllers/vouchers_controller.rb:23:in `create' +Started POST "/vouchers?voucher=PromoStarr&vouchee=Scootzaar" for ::1 at 2019-10-08 21:32:10 +0200 +Processing by VouchersController#create as HTML + Parameters: {"voucher"=>"PromoStarr", "vouchee"=>"Scootzaar"} +Completed 500 Internal Server Error in 119ms (ActiveRecord: 0.0ms | Allocations: 174) + + + +NoMethodError (undefined method `split' for nil:NilClass): + +app/controllers/vouchers_controller.rb:24:in `create' +Started POST "/vouchers?voucher=PromoStarr&vouchee=Scootzaar" for ::1 at 2019-10-08 21:32:37 +0200 +Processing by VouchersController#create as HTML + Parameters: {"voucher"=>"PromoStarr", "vouchee"=>"Scootzaar"} + Voucher Exists? (0.1ms) SELECT 1 AS one FROM `vouchers` WHERE `vouchers`.`vouchee` = 'PromoStarr' LIMIT 1 + ↳ app/controllers/vouchers_controller.rb:26:in `create' + CACHE Voucher Exists? (0.0ms) SELECT 1 AS one FROM `vouchers` WHERE `vouchers`.`vouchee` = 'PromoStarr' LIMIT 1 + ↳ app/controllers/vouchers_controller.rb:37:in `create' +Completed 422 Unprocessable Entity in 117ms (Views: 0.1ms | ActiveRecord: 0.6ms | Allocations: 2361) + + +Started POST "/vouchers?voucher=PromoStarr&vouchee=Scootzaar" for ::1 at 2019-10-08 21:33:47 +0200 +Processing by VouchersController#create as HTML + Parameters: {"voucher"=>"PromoStarr", "vouchee"=>"Scootzaar"} + Voucher Exists? (0.2ms) SELECT 1 AS one FROM `vouchers` WHERE `vouchers`.`vouchee` = 'PromoStarr' LIMIT 1 + ↳ app/controllers/vouchers_controller.rb:26:in `create' + CACHE Voucher Exists? (0.0ms) SELECT 1 AS one FROM `vouchers` WHERE `vouchers`.`vouchee` = 'PromoStarr' LIMIT 1 + ↳ app/controllers/vouchers_controller.rb:37:in `create' +Completed 422 Unprocessable Entity in 120ms (Views: 0.1ms | ActiveRecord: 0.6ms | Allocations: 1746) + + +Started POST "/vouchers?voucher=PromoStarr&vouchee=Scootzaar" for ::1 at 2019-10-08 21:34:19 +0200 +Processing by VouchersController#create as HTML + Parameters: {"voucher"=>"PromoStarr", "vouchee"=>"Scootzaar"} + Voucher Exists? (0.2ms) SELECT 1 AS one FROM `vouchers` WHERE `vouchers`.`vouchee` = 'PromoStarr' LIMIT 1 + ↳ app/controllers/vouchers_controller.rb:26:in `create' + CACHE Voucher Exists? (0.0ms) SELECT 1 AS one FROM `vouchers` WHERE `vouchers`.`vouchee` = 'PromoStarr' LIMIT 1 + ↳ app/controllers/vouchers_controller.rb:37:in `create' +Completed 422 Unprocessable Entity in 124ms (Views: 0.1ms | ActiveRecord: 0.6ms | Allocations: 1740) + + +Started POST "/vouchers?voucher=PromoStarr&vouchee=Scootzaar" for ::1 at 2019-10-08 21:34:25 +0200 +Processing by VouchersController#create as HTML + Parameters: {"voucher"=>"PromoStarr", "vouchee"=>"Scootzaar"} + Voucher Exists? (0.3ms) SELECT 1 AS one FROM `vouchers` WHERE `vouchers`.`vouchee` = 'PromoStarr' LIMIT 1 + ↳ app/controllers/vouchers_controller.rb:26:in `create' + CACHE Voucher Exists? (0.0ms) SELECT 1 AS one FROM `vouchers` WHERE `vouchers`.`vouchee` = 'PromoStarr' LIMIT 1 + ↳ app/controllers/vouchers_controller.rb:37:in `create' +Completed 422 Unprocessable Entity in 122ms (Views: 0.2ms | ActiveRecord: 1.7ms | Allocations: 1774) + + +Started POST "/vouchers?voucher=PromoStarr&vouchee=Scootzaar" for ::1 at 2019-10-08 21:34:33 +0200 +Processing by VouchersController#create as HTML + Parameters: {"voucher"=>"PromoStarr", "vouchee"=>"Scootzaar"} + Voucher Exists? (0.2ms) SELECT 1 AS one FROM `vouchers` WHERE `vouchers`.`vouchee` = 'PromoStarr' LIMIT 1 + ↳ app/controllers/vouchers_controller.rb:25:in `create' + CACHE Voucher Exists? (0.0ms) SELECT 1 AS one FROM `vouchers` WHERE `vouchers`.`vouchee` = 'PromoStarr' LIMIT 1 + ↳ app/controllers/vouchers_controller.rb:36:in `create' +Completed 422 Unprocessable Entity in 110ms (Views: 0.1ms | ActiveRecord: 2.0ms | Allocations: 1772) + + +Started POST "/vouchers?voucher=PromoStarr&vouchee=Scootzaar" for ::1 at 2019-10-08 21:34:46 +0200 +Processing by VouchersController#create as HTML + Parameters: {"voucher"=>"PromoStarr", "vouchee"=>"Scootzaar"} + Voucher Exists? (0.4ms) SELECT 1 AS one FROM `vouchers` WHERE `vouchers`.`vouchee` = 'PromoStarr' LIMIT 1 + ↳ app/controllers/vouchers_controller.rb:26:in `create' + CACHE Voucher Exists? (0.0ms) SELECT 1 AS one FROM `vouchers` WHERE `vouchers`.`vouchee` = 'PromoStarr' LIMIT 1 + ↳ app/controllers/vouchers_controller.rb:37:in `create' +Completed 422 Unprocessable Entity in 112ms (Views: 0.2ms | ActiveRecord: 1.1ms | Allocations: 1763) + + +Started POST "/vouchers?voucher=PromoStarr&vouchee=Scootzaar" for ::1 at 2019-10-08 21:34:54 +0200 +Processing by VouchersController#create as HTML + Parameters: {"voucher"=>"PromoStarr", "vouchee"=>"Scootzaar"} + Voucher Exists? (0.2ms) SELECT 1 AS one FROM `vouchers` WHERE `vouchers`.`vouchee` = 'PromoStarr' LIMIT 1 + ↳ app/controllers/vouchers_controller.rb:26:in `create' + CACHE Voucher Exists? (0.0ms) SELECT 1 AS one FROM `vouchers` WHERE `vouchers`.`vouchee` = 'PromoStarr' LIMIT 1 + ↳ app/controllers/vouchers_controller.rb:37:in `create' +Completed 422 Unprocessable Entity in 125ms (Views: 0.1ms | ActiveRecord: 0.8ms | Allocations: 1764) + + +Started POST "/vouchers?voucher=PromoStarr&vouchee=Scootzaar" for ::1 at 2019-10-08 21:35:02 +0200 +Processing by VouchersController#create as HTML + Parameters: {"voucher"=>"PromoStarr", "vouchee"=>"Scootzaar"} + Voucher Exists? (0.2ms) SELECT 1 AS one FROM `vouchers` WHERE `vouchers`.`vouchee` = 'PromoStarr' LIMIT 1 + ↳ app/controllers/vouchers_controller.rb:26:in `create' + CACHE Voucher Exists? (0.0ms) SELECT 1 AS one FROM `vouchers` WHERE `vouchers`.`vouchee` = 'PromoStarr' LIMIT 1 + ↳ app/controllers/vouchers_controller.rb:37:in `create' +Completed 422 Unprocessable Entity in 96ms (Views: 0.1ms | ActiveRecord: 0.9ms | Allocations: 1740) + + +Started POST "/vouchers?voucher=PromoStarr&vouchee=Scootzaar" for ::1 at 2019-10-08 21:35:08 +0200 +Processing by VouchersController#create as HTML + Parameters: {"voucher"=>"PromoStarr", "vouchee"=>"Scootzaar"} + Voucher Exists? (0.3ms) SELECT 1 AS one FROM `vouchers` WHERE `vouchers`.`vouchee` = 'PromoStarr' LIMIT 1 + ↳ app/controllers/vouchers_controller.rb:26:in `create' + CACHE Voucher Exists? (0.0ms) SELECT 1 AS one FROM `vouchers` WHERE `vouchers`.`vouchee` = 'PromoStarr' LIMIT 1 + ↳ app/controllers/vouchers_controller.rb:37:in `create' +Completed 422 Unprocessable Entity in 106ms (Views: 0.1ms | ActiveRecord: 0.3ms | Allocations: 1281) + + +Started POST "/vouchers?voucher=PromoStarr&vouchee=Scootzaar" for ::1 at 2019-10-08 21:37:55 +0200 + +SyntaxError (/media/Linux-Shared/dev/gitlab.com/vereto-api/app/controllers/vouchers_controller.rb:37: syntax error, unexpected ',', expecting => +...son: { 'Voucher is not valid.', ["whitelisted", params[:vouc... +... ^ +/media/Linux-Shared/dev/gitlab.com/vereto-api/app/controllers/vouchers_controller.rb:37: syntax error, unexpected ',', expecting end +...rams[:voucher].in?(whitelist)], ["Exists", Voucher.exists?(v... +... ^ +/media/Linux-Shared/dev/gitlab.com/vereto-api/app/controllers/vouchers_controller.rb:37: syntax error, unexpected ',', expecting end +...s?(vouchee: params[:voucher])], [whitelist.to_s]}, status: :... +... ^ +/media/Linux-Shared/dev/gitlab.com/vereto-api/app/controllers/vouchers_controller.rb:37: syntax error, unexpected '}', expecting end +...[:voucher])], [whitelist.to_s]}, status: :unprocessable_enti... +... ^): + +app/controllers/vouchers_controller.rb:37: syntax error, unexpected ',', expecting => +app/controllers/vouchers_controller.rb:37: syntax error, unexpected ',', expecting end +app/controllers/vouchers_controller.rb:37: syntax error, unexpected ',', expecting end +app/controllers/vouchers_controller.rb:37: syntax error, unexpected '}', expecting end +app/controllers/vouchers_controller.rb:37: syntax error, unexpected ',', expecting => +app/controllers/vouchers_controller.rb:37: syntax error, unexpected ',', expecting end +app/controllers/vouchers_controller.rb:37: syntax error, unexpected ',', expecting end +app/controllers/vouchers_controller.rb:37: syntax error, unexpected '}', expecting end +Started POST "/vouchers?voucher=PromoStarr&vouchee=Scootzaar" for ::1 at 2019-10-08 21:40:00 +0200 + +SyntaxError (/media/Linux-Shared/dev/gitlab.com/vereto-api/app/controllers/vouchers_controller.rb:37: syntax error, unexpected ',', expecting => +...son: { 'Voucher is not valid.', :whitelisted => params[:vouc... +... ^ +/media/Linux-Shared/dev/gitlab.com/vereto-api/app/controllers/vouchers_controller.rb:37: syntax error, unexpected ',', expecting end +...arams[:voucher].in?(whitelist), :exists => Voucher.exists?(v... +... ^ +/media/Linux-Shared/dev/gitlab.com/vereto-api/app/controllers/vouchers_controller.rb:37: syntax error, unexpected ',', expecting end +...ts?(vouchee: params[:voucher]), [whitelist.to_s]}.to_json, s... +... ^ +/media/Linux-Shared/dev/gitlab.com/vereto-api/app/controllers/vouchers_controller.rb:37: syntax error, unexpected '}', expecting end +...s[:voucher]), [whitelist.to_s]}.to_json, status: :unprocessa... +... ^): + +app/controllers/vouchers_controller.rb:37: syntax error, unexpected ',', expecting => +app/controllers/vouchers_controller.rb:37: syntax error, unexpected ',', expecting end +app/controllers/vouchers_controller.rb:37: syntax error, unexpected ',', expecting end +app/controllers/vouchers_controller.rb:37: syntax error, unexpected '}', expecting end +app/controllers/vouchers_controller.rb:37: syntax error, unexpected ',', expecting => +app/controllers/vouchers_controller.rb:37: syntax error, unexpected ',', expecting end +app/controllers/vouchers_controller.rb:37: syntax error, unexpected ',', expecting end +app/controllers/vouchers_controller.rb:37: syntax error, unexpected '}', expecting end +Started POST "/vouchers?voucher=PromoStarr&vouchee=Scootzaar" for ::1 at 2019-10-08 21:41:01 +0200 + +SyntaxError (/media/Linux-Shared/dev/gitlab.com/vereto-api/app/controllers/vouchers_controller.rb:37: syntax error, unexpected '}', expecting => +...s[:voucher]), [whitelist.to_s]}.to_json, status: :unprocessa... +... ^): + +app/controllers/vouchers_controller.rb:37: syntax error, unexpected '}', expecting => +app/controllers/vouchers_controller.rb:37: syntax error, unexpected '}', expecting => +Started POST "/vouchers?voucher=PromoStarr&vouchee=Scootzaar" for ::1 at 2019-10-08 21:41:24 +0200 +Processing by VouchersController#create as HTML + Parameters: {"voucher"=>"PromoStarr", "vouchee"=>"Scootzaar"} + Voucher Exists? (0.2ms) SELECT 1 AS one FROM `vouchers` WHERE `vouchers`.`vouchee` = 'PromoStarr' LIMIT 1 + ↳ app/controllers/vouchers_controller.rb:26:in `create' + CACHE Voucher Exists? (0.0ms) SELECT 1 AS one FROM `vouchers` WHERE `vouchers`.`vouchee` = 'PromoStarr' LIMIT 1 + ↳ app/controllers/vouchers_controller.rb:37:in `create' +Completed 422 Unprocessable Entity in 105ms (Views: 0.2ms | ActiveRecord: 0.9ms | Allocations: 1822) + + +Started POST "/vouchers?voucher=PromoStarr&vouchee=Scootzaar" for ::1 at 2019-10-08 21:41:36 +0200 +Processing by VouchersController#create as HTML + Parameters: {"voucher"=>"PromoStarr", "vouchee"=>"Scootzaar"} + Voucher Exists? (0.2ms) SELECT 1 AS one FROM `vouchers` WHERE `vouchers`.`vouchee` = 'PromoStarr' LIMIT 1 + ↳ app/controllers/vouchers_controller.rb:26:in `create' + CACHE Voucher Exists? (0.0ms) SELECT 1 AS one FROM `vouchers` WHERE `vouchers`.`vouchee` = 'PromoStarr' LIMIT 1 + ↳ app/controllers/vouchers_controller.rb:37:in `create' +Completed 422 Unprocessable Entity in 113ms (Views: 0.2ms | ActiveRecord: 0.7ms | Allocations: 1870) + + +Started POST "/vouchers?voucher=PromoStarr&vouchee=Scootzaar" for ::1 at 2019-10-08 21:42:32 +0200 +Processing by VouchersController#create as HTML + Parameters: {"voucher"=>"PromoStarr", "vouchee"=>"Scootzaar"} + Voucher Exists? (0.1ms) SELECT 1 AS one FROM `vouchers` WHERE `vouchers`.`vouchee` = 'PromoStarr' LIMIT 1 + ↳ app/controllers/vouchers_controller.rb:26:in `create' + CACHE Voucher Exists? (0.0ms) SELECT 1 AS one FROM `vouchers` WHERE `vouchers`.`vouchee` = 'PromoStarr' LIMIT 1 + ↳ app/controllers/vouchers_controller.rb:37:in `create' +Completed 422 Unprocessable Entity in 105ms (Views: 0.1ms | ActiveRecord: 0.5ms | Allocations: 1875) + + +Started GET "/vouchers" for ::1 at 2019-10-08 21:42:53 +0200 +Processing by VouchersController#index as */* + Voucher Load (0.4ms) SELECT `vouchers`.* FROM `vouchers` + ↳ app/controllers/vouchers_controller.rb:9:in `zip' +Completed 200 OK in 114ms (Views: 0.2ms | ActiveRecord: 0.4ms | Allocations: 715) + + +Started POST "/vouchers?voucher=PromoStarr&vouchee=Scootzaar" for ::1 at 2019-10-08 21:45:12 +0200 +  (0.5ms) SET @@SESSION.sql_mode = CONCAT(CONCAT(@@sql_mode, ',STRICT_ALL_TABLES'), ',NO_AUTO_VALUE_ON_ZERO'), @@SESSION.sql_auto_is_null = 0, @@SESSION.wait_timeout = 2147483 +  (0.4ms) SELECT `schema_migrations`.`version` FROM `schema_migrations` ORDER BY `schema_migrations`.`version` ASC +Processing by VouchersController#create as HTML + Parameters: {"voucher"=>"PromoStarr", "vouchee"=>"Scootzaar"} +DEPRECATION WARNING: Uniqueness validator will no longer enforce case sensitive comparison in Rails 6.1. To continue case sensitive comparison on the :vouchee attribute in Voucher model, pass `case_sensitive: true` option explicitly to the uniqueness validator. (called from create at /media/Linux-Shared/dev/gitlab.com/vereto-api/app/controllers/vouchers_controller.rb:29) +  (0.2ms) BEGIN + ↳ app/controllers/vouchers_controller.rb:29:in `create' + Voucher Exists? (0.3ms) SELECT 1 AS one FROM `vouchers` WHERE `vouchers`.`vouchee` = BINARY 'Scootzaar' LIMIT 1 + ↳ app/controllers/vouchers_controller.rb:29:in `create' + Voucher Create (0.3ms) INSERT INTO `vouchers` (`voucher`, `vouchee`, `created_at`, `updated_at`) VALUES ('PromoStarr', 'Scootzaar', '2019-10-08 19:45:12.912282', '2019-10-08 19:45:12.912282') + ↳ app/controllers/vouchers_controller.rb:29:in `create' +  (3.0ms) COMMIT + ↳ app/controllers/vouchers_controller.rb:29:in `create' +Completed 201 Created in 230ms (Views: 0.5ms | ActiveRecord: 4.9ms | Allocations: 8547) + + +Started GET "/vouchers" for ::1 at 2019-10-08 21:45:20 +0200 +Processing by VouchersController#index as */* + Voucher Load (0.4ms) SELECT `vouchers`.* FROM `vouchers` + ↳ app/controllers/vouchers_controller.rb:9:in `zip' +Completed 200 OK in 124ms (Views: 0.5ms | ActiveRecord: 0.4ms | Allocations: 880) + + +Started POST "/vouchers?voucher=PromoStarr&vouchee=PromoStarr" for ::1 at 2019-10-08 21:45:28 +0200 +Processing by VouchersController#create as HTML + Parameters: {"voucher"=>"PromoStarr", "vouchee"=>"PromoStarr"} +DEPRECATION WARNING: Uniqueness validator will no longer enforce case sensitive comparison in Rails 6.1. To continue case sensitive comparison on the :vouchee attribute in Voucher model, pass `case_sensitive: true` option explicitly to the uniqueness validator. (called from create at /media/Linux-Shared/dev/gitlab.com/vereto-api/app/controllers/vouchers_controller.rb:29) +  (0.2ms) BEGIN + ↳ app/controllers/vouchers_controller.rb:29:in `create' + Voucher Exists? (0.3ms) SELECT 1 AS one FROM `vouchers` WHERE `vouchers`.`vouchee` = BINARY 'PromoStarr' LIMIT 1 + ↳ app/controllers/vouchers_controller.rb:29:in `create' + Voucher Create (0.2ms) INSERT INTO `vouchers` (`voucher`, `vouchee`, `created_at`, `updated_at`) VALUES ('PromoStarr', 'PromoStarr', '2019-10-08 19:45:28.706119', '2019-10-08 19:45:28.706119') + ↳ app/controllers/vouchers_controller.rb:29:in `create' +  (4.4ms) COMMIT + ↳ app/controllers/vouchers_controller.rb:29:in `create' +Completed 201 Created in 265ms (Views: 0.5ms | ActiveRecord: 5.0ms | Allocations: 3544) + + +Started GET "/vouchers" for ::1 at 2019-10-08 21:45:32 +0200 +Processing by VouchersController#index as */* + Voucher Load (0.3ms) SELECT `vouchers`.* FROM `vouchers` + ↳ app/controllers/vouchers_controller.rb:9:in `zip' +Completed 200 OK in 116ms (Views: 1.0ms | ActiveRecord: 0.3ms | Allocations: 957) + + +Started POST "/vouchers?voucher=PromoStarr&vouchee=KittyCatInBlue" for ::1 at 2019-10-08 21:45:52 +0200 +Processing by VouchersController#create as HTML + Parameters: {"voucher"=>"PromoStarr", "vouchee"=>"KittyCatInBlue"} + Voucher Exists? (0.3ms) SELECT 1 AS one FROM `vouchers` WHERE `vouchers`.`vouchee` = 'PromoStarr' LIMIT 1 + ↳ app/controllers/vouchers_controller.rb:26:in `create' +DEPRECATION WARNING: Uniqueness validator will no longer enforce case sensitive comparison in Rails 6.1. To continue case sensitive comparison on the :vouchee attribute in Voucher model, pass `case_sensitive: true` option explicitly to the uniqueness validator. (called from create at /media/Linux-Shared/dev/gitlab.com/vereto-api/app/controllers/vouchers_controller.rb:29) +  (0.1ms) BEGIN + ↳ app/controllers/vouchers_controller.rb:29:in `create' + Voucher Exists? (0.3ms) SELECT 1 AS one FROM `vouchers` WHERE `vouchers`.`vouchee` = BINARY 'KittyCatInBlue' LIMIT 1 + ↳ app/controllers/vouchers_controller.rb:29:in `create' + Voucher Create (0.2ms) INSERT INTO `vouchers` (`voucher`, `vouchee`, `created_at`, `updated_at`) VALUES ('PromoStarr', 'KittyCatInBlue', '2019-10-08 19:45:53.145236', '2019-10-08 19:45:53.145236') + ↳ app/controllers/vouchers_controller.rb:29:in `create' +  (2.9ms) COMMIT + ↳ app/controllers/vouchers_controller.rb:29:in `create' +Completed 201 Created in 268ms (Views: 0.4ms | ActiveRecord: 5.2ms | Allocations: 8073) + + +Started GET "/vouchers" for ::1 at 2019-10-08 21:45:56 +0200 +Processing by VouchersController#index as */* + Voucher Load (0.3ms) SELECT `vouchers`.* FROM `vouchers` + ↳ app/controllers/vouchers_controller.rb:9:in `zip' +Completed 200 OK in 119ms (Views: 0.5ms | ActiveRecord: 0.3ms | Allocations: 1073) + + +Started POST "/vouchers?voucher=PromoStarr&vouchee=KittyCatInBlue" for ::1 at 2019-10-08 21:46:28 +0200 +Processing by VouchersController#create as HTML + Parameters: {"voucher"=>"PromoStarr", "vouchee"=>"KittyCatInBlue"} + Voucher Exists? (0.2ms) SELECT 1 AS one FROM `vouchers` WHERE `vouchers`.`vouchee` = 'PromoStarr' LIMIT 1 + ↳ app/controllers/vouchers_controller.rb:26:in `create' +DEPRECATION WARNING: Uniqueness validator will no longer enforce case sensitive comparison in Rails 6.1. To continue case sensitive comparison on the :vouchee attribute in Voucher model, pass `case_sensitive: true` option explicitly to the uniqueness validator. (called from create at /media/Linux-Shared/dev/gitlab.com/vereto-api/app/controllers/vouchers_controller.rb:29) +  (0.2ms) BEGIN + ↳ app/controllers/vouchers_controller.rb:29:in `create' + Voucher Exists? (0.4ms) SELECT 1 AS one FROM `vouchers` WHERE `vouchers`.`vouchee` = BINARY 'KittyCatInBlue' LIMIT 1 + ↳ app/controllers/vouchers_controller.rb:29:in `create' +  (0.1ms) ROLLBACK + ↳ app/controllers/vouchers_controller.rb:29:in `create' +Completed 422 Unprocessable Entity in 274ms (Views: 0.1ms | ActiveRecord: 2.3ms | Allocations: 182961) + +