Skip to content
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

Posting a Resource with Circular References breaks when Application also includes ActiveSupport #87

Open
dlitvakb opened this issue Feb 25, 2016 · 0 comments
Assignees

Comments

@dlitvakb
Copy link
Contributor

dlitvakb commented Feb 25, 2016

When your app requires ActiveSupport and you have a resource with circular references.

As ActiveSupport patches HTTP::Client to call ActiveSupport#to_json on #post and #put.

This causes a never-ending loop that will halt any other operations. This affects specifically Entry#save in the case of circular references.

Fix required is very simple:

module Contentful
  module Management
    class Entry
      alias_method :to_json, :fields_for_query
    end
  end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant