def cast_big_decimal(obj)
      case obj
      when BigDecimal
        obj.to_f
      when Hash
        obj.each do |k, v|
          # performance
          if v.is_a?(BigDecimal)
            obj[k] = v.to_f
          elsif v.is_a?(Enumerable)
            obj[k] = cast_big_decimal(v)
          end
        end
      when Enumerable
        obj.map do |v|
          cast_big_decimal(v)
        end
      else
        obj
      end
    end
def cast_big_decimal(obj)
      case obj
      when BigDecimal
        obj.to_f
      when Hash
        obj.each do |k, v|
          # performance
          if v.is_a?(BigDecimal)
            obj[k] = v.to_f
          elsif v.is_a?(Enumerable)
            obj[k] = cast_big_decimal(v)
          end
        end
      when Enumerable
        obj.map do |v|
          cast_big_decimal(v)
        end
      else
        obj
      end
    end
change all BigDecimal values to floats due to
 https://github.com/rails/rails/issues/6033
 possible loss of precision :/