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

Contentful::Entry-objects not dumpable #80

Closed
toadle opened this issue Dec 3, 2015 · 4 comments
Closed

Contentful::Entry-objects not dumpable #80

toadle opened this issue Dec 3, 2015 · 4 comments
Assignees
Labels

Comments

@toadle
Copy link
Contributor

toadle commented Dec 3, 2015

Hey guys,

I'm sorry to bother you with another thing, but this is just the stuff coming up while working on our project.

I've been trying to cache certain objects retrieved with contentful.rb in order to make certain requests not hit the API all the time. Makes page-loads faster.

Therefore I wanted to put a Contentful::Category < Contentful::Entry-object into the Rails-Cache. In this process the objects gets Marshal.dumped.

Doing that reveals that somewhere inside the object there must be a Proc assigned, because:

Marshal.dump client.entries({"content_type" => "<some entry-id>"}).first
TypeError: no _dump_data is defined for class Proc
from (pry):4:in `dump'

I can't figure out where, cause I already tried writing my own marshal_dump / marshal_load-methods.

During testing I noticed that everything that https://github.com/errorstudio/contentful_model hands out, is cachable without problems.

Any hints?

@dlitvakb
Copy link
Contributor

dlitvakb commented Dec 3, 2015

Hey @toadle,

Thanks for the input,

I've never personally tried to do such thing, so haven't come up with it.

I'll be looking into what's going on and how to fix it.

@dlitvakb
Copy link
Contributor

dlitvakb commented Dec 7, 2015

Hey @toadle,

I've just finished the PR that covers #79 and this issue.

You can check it out here: #81

We'll be merging this soon and getting a new release.

Until then, can you try using this branch and see if it covers your needs?

Please let me know if you need any further help.

@toadle
Copy link
Contributor Author

toadle commented Dec 8, 2015

@dlitvakb Thanks for working on this so fast.
We just started a new sprint yesterday and left this out intentionally. But I'll figure this in and give you feedback!

@toadle
Copy link
Contributor Author

toadle commented Dec 8, 2015

@dlitvakb I directly commented on #81 .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants