Skip to content

Commit

Permalink
fix: context now dumps to JSON correctly (#212)
Browse files Browse the repository at this point in the history
  • Loading branch information
sighphyre authored Oct 24, 2024
1 parent 4d7d231 commit 3a19f49
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 4 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@ Note: These changes are not considered notable:

## [Unreleased]

## [6.0.5] - 2024-09-25
## [6.0.7] - 2024-10-24
#### Fixed
- Context object correctly dumps to JSON

## [6.0.6] - 2024-10-23
#### Changed
- Upgrade core engine library to allow ffi version 1.16.3

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Ruby client for the [Unleash](https://github.com/Unleash/unleash) feature manage
Add this line to your application's Gemfile:

```ruby
gem 'unleash', '~> 6.0.6'
gem 'unleash', '~> 6.0.7'
```

And then execute:
Expand Down
2 changes: 1 addition & 1 deletion lib/unleash/context.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def to_s
",app_name=#{@app_name},environment=#{@environment},current_time=#{@current_time}>"
end

def as_json
def as_json(*_options)
{
appName: to_safe_value(self.app_name),
environment: to_safe_value(self.environment),
Expand Down
2 changes: 1 addition & 1 deletion lib/unleash/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module Unleash
VERSION = "6.0.6".freeze
VERSION = "6.0.7".freeze
end
4 changes: 4 additions & 0 deletions spec/unleash/context_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -189,4 +189,8 @@
context = Unleash::Context.new(params)
expect(context.to_h).to eq(params)
end

it "converts to json without error" do
expect { JSON.dump(Unleash::Context.new) }.not_to raise_error
end
end

0 comments on commit 3a19f49

Please sign in to comment.