Skip to content

Commit

Permalink
Avoid stringifying values of null 'id' keys
Browse files Browse the repository at this point in the history
  • Loading branch information
harigopal committed Sep 16, 2019
1 parent 4b58006 commit 535557c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/stringify_ids.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ def stringify_ids(hash)
stringify_ids_in_array(string_key, original_value)
elsif original_value.respond_to?(:key?)
stringify_ids(original_value)
elsif string_key == 'id' || string_key.ends_with?('_id') && original_value.is_a?(Numeric)
elsif (string_key == 'id' || string_key.ends_with?('_id')) && original_value.is_a?(Numeric)
original_value.to_s
else
original_value
Expand Down

0 comments on commit 535557c

Please sign in to comment.