Skip to content

bigdecimal 2 support #370

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Sep 9, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ rvm:
- 2.4.1
- 2.5.1
- 2.6.0
- 2.7.1
env:
global:
- CODECLIMATE_REPO_TOKEN=396d4263adb6febf1e6e9b0c0e176fbde35e1a116a3c1ecf8dd4f9384e41979b
Expand Down Expand Up @@ -47,6 +48,14 @@ matrix:
gemfile: gemfiles/4.1.gemfile
- rvm: 2.6.0
gemfile: gemfiles/4.2.gemfile
- rvm: 2.7.1
gemfile: gemfiles/3.2.gemfile
- rvm: 2.7.1
gemfile: gemfiles/4.0.gemfile
- rvm: 2.7.1
gemfile: gemfiles/4.1.gemfile
- rvm: 2.7.1
gemfile: gemfiles/4.2.gemfile
# We need to install latest version of bundler, because one in travis
# image is too old to recognize platform => :mri_22 in Gemfile.
before_install:
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

## Unreleased

## 1.17.1
- [#370](https://github.com/JsonApiClient/json_api_client/pull/370) - bigdecimal 2 support

## 1.17.0

- [#364](https://github.com/JsonApiClient/json_api_client/pull/364) - Relax faraday and faraday middleware versions
Expand Down
2 changes: 1 addition & 1 deletion lib/json_api_client/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def self.cast(value, _)

class Decimal
def self.cast(value, _)
BigDecimal.new(value)
BigDecimal(value)
end
end

Expand Down
2 changes: 1 addition & 1 deletion lib/json_api_client/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module JsonApiClient
VERSION = "1.17.0"
VERSION = "1.17.1"
end
2 changes: 1 addition & 1 deletion test/unit/coercion_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,6 @@ def validate_coercion_targets(target)
assert_equal target.integer_me, 2
assert_equal target.string_me, '1.0'
assert_equal target.time_me, Time.parse(TIME_STRING)
assert_equal target.decimal_me, BigDecimal.new('1.5')
assert_equal target.decimal_me, BigDecimal('1.5')
end
end