Skip to content

Commit

Permalink
Converting Fixnum to Integer
Browse files Browse the repository at this point in the history
  • Loading branch information
benrugg committed Apr 21, 2017
1 parent 1d43fcd commit bce410c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Expand Up @@ -2,6 +2,11 @@

## Unreleased

## 0.7.1

* Convert Fixnum to Integer, for Ruby >= 2.4.0. ([Ben
Rugg](https://github.com/benrugg))

## 0.7.0

* Support for `mutable-content` flag (for iOS 10). ([Matthias
Expand Down
3 changes: 2 additions & 1 deletion lib/grocer/extensions/deep_symbolize_keys.rb
Expand Up @@ -6,7 +6,8 @@ def deep_symbolize_keys
result = {}
each do |key, value|
# Workaround for JRuby defining Fixnum#to_sym even in 1.9 mode
symbolized_key = key.is_a?(Fixnum) ? key : (key.to_sym rescue key)
# (now updated to Integer, for Ruby >= 2.4.0)
symbolized_key = key.is_a?(Integer) ? key : (key.to_sym rescue key)

result[symbolized_key] = value.is_a?(Hash) ?
(value.extend DeepSymbolizeKeys).deep_symbolize_keys : value
Expand Down
2 changes: 1 addition & 1 deletion lib/grocer/version.rb
@@ -1,3 +1,3 @@
module Grocer
VERSION = '0.7.0'
VERSION = '0.7.1'
end

0 comments on commit bce410c

Please sign in to comment.