Skip to content

on foo_create, facebook returns an ID (string) that blows up map_data #142

Open
@klochner

Description

example:

post = Mogli::Post.find(some_post_id)
post.comments_create({message: "hello"})

The call to client.post will return a string, which blows up with this stack trace (line numbers may be off):

 NoMethodError - undefined method `each' for  
                       "20151777981831111_57381111":String:
 (gem) mogli-0.0.42/lib/mogli/model.rb:22:in `Mogli::Comment#initialize'
 (gem) mogli-0.0.42/lib/mogli/client.rb:219:in `Mogli::Client#create_instance'
 (gem) mogli-0.0.42/lib/mogli/client.rb:219:in `Mogli::Client#map_to_class'
 (gem) mogli-0.0.42/lib/mogli/client.rb:210:in `Mogli::Client#map_data'
 (gem) mogli-0.0.42/lib/mogli/client.rb:169:in `Mogli::Client#post'

I'm hesitant to try hacking a fix, since there may be other non-hash/array values that need to be handled by other calls. This may be fixable by setting a default field as done here:

#127

@yitaosun - can you take a look? This looks similar to the fix you put in for location.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions