Skip to content

Commit 599031b

Browse files
Markus Mühlbergerbeauby
Markus Mühlberger
authored andcommitted
Deal with jsonapi-serializable no longer calling to_json (#26)
* Fixes issue with jsonapi-serializable no longer calling to_json * Pin jsonapi-serializable to >= 0.1.3
1 parent ee3acf6 commit 599031b

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

jsonapi-rails.gemspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Gem::Specification.new do |spec|
1414
spec.files = Dir['README.md', 'lib/**/*']
1515
spec.require_path = 'lib'
1616

17-
spec.add_dependency 'jsonapi-rb', '~> 0.1'
17+
spec.add_dependency 'jsonapi-rb', '~> 0.1', '>= 0.1.3'
1818

1919
spec.add_development_dependency 'rails', '~> 5.0'
2020
spec.add_development_dependency 'sqlite3'

lib/jsonapi/rails/renderer.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ def rails_renderer(renderer)
3232
# has access to the request object.
3333
reverse_mapping = request.env[ActionController::REVERSE_MAPPING_KEY]
3434
options = options.merge(_reverse_mapping: reverse_mapping)
35-
json = renderer.render(json, options) unless json.is_a?(String)
35+
json = renderer.render(json, options).to_json unless json.is_a?(String)
3636
self.content_type ||= Mime[:jsonapi]
3737
self.response_body = json
3838
end

0 commit comments

Comments
 (0)