From 0ca5f19509bdca4c03faf70420801e5424ccf461 Mon Sep 17 00:00:00 2001 From: Donovan Daniels Date: Tue, 6 Aug 2024 05:24:51 -0500 Subject: [PATCH] Fix implicit hash conversion issue --- app/controllers/yiff_rest/api_v2_controller.rb | 2 +- app/logical/api_category.rb | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/app/controllers/yiff_rest/api_v2_controller.rb b/app/controllers/yiff_rest/api_v2_controller.rb index 275f944..1fc1711 100644 --- a/app/controllers/yiff_rest/api_v2_controller.rb +++ b/app/controllers/yiff_rest/api_v2_controller.rb @@ -76,7 +76,7 @@ module YiffRest render(json: { success: true, data: { - **APIImage.categories.find { |c| c.db == category }, + **APIImage.categories.find { |c| c.db == category }.to_h, count: count, }, }) diff --git a/app/logical/api_category.rb b/app/logical/api_category.rb index ce10715..35a7f57 100644 --- a/app/logical/api_category.rb +++ b/app/logical/api_category.rb @@ -61,4 +61,6 @@ class APICategory count: count, } end + + alias to_h as_json end