lib/shapewear/request.rb in shapewear-0.1.7 vs lib/shapewear/request.rb in shapewear-0.1.8

- old
+ new

@@ -133,10 +133,10 @@ # @param obj [Hash,Object] The resulting object. # @param field [Symbol,String] The field to extract. # @param type [Class] The type to convert. def extract_and_serialize_value(builder, obj, field, type) v = if obj.is_a?(Hash) - obj[field] or obj[field.underscore] + obj[field] or obj[field.to_sym] or obj[field.to_s.underscore] or obj[field.to_s.underscore.to_sym] elsif obj.respond_to?(field) obj.send(field) elsif obj.respond_to?(field.underscore) obj.send(field.underscore) else