From 6e44543cbbe630702ecc2cc3a3bfdacb02476e22 Mon Sep 17 00:00:00 2001 From: Angus McLeod Date: Tue, 21 Mar 2023 17:38:53 +0100 Subject: [PATCH] Strings are Objects in ruby --- lib/custom_wizard/mapper.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/custom_wizard/mapper.rb b/lib/custom_wizard/mapper.rb index 41519b07..4e18ad01 100644 --- a/lib/custom_wizard/mapper.rb +++ b/lib/custom_wizard/mapper.rb @@ -44,7 +44,7 @@ class CustomWizard::Mapper def initialize(params) @inputs = params[:inputs] || {} - @data = params[:data].with_indifferent_access || {} + @data = params[:data] ? params[:data].with_indifferent_access : {} @user = params[:user] @opts = params[:opts] || {} end @@ -269,7 +269,7 @@ class CustomWizard::Mapper result = data[k] if keys.empty? - result.is_a?(Object) ? "" : result + result.is_a?(Hash) ? "" : result else self.recurse(result, keys) end