datocms / ruby-datocms-client

Ruby client for the DatoCMS API.
https://www.datocms.com/docs/content-management-api/using-the-ruby-client
MIT License
20 stars 14 forks source link

Pictures raise an exception when `to_hash` is called. #8

Closed dewyze closed 7 years ago

dewyze commented 7 years ago

I noticed this in both the middleman-dato client as well as the cli. The examples both reference a method that loops through all items and calls to_hash but if one of those fields is a picture, this error is raised:

Fetching content from DatoCMS... /Users/john/.rvm/gems/ruby-2.3.0/gems/dato-0.3.7/lib/dato/dump/dsl/root.rb:24:in `eval': wrong number of arguments (given 0, expected 1) (Argume
ntError)
        from /Users/john/.rvm/gems/ruby-2.3.0/gems/dato-0.3.7/lib/dato/local/field_type/file.rb:40:in `to_hash'
        from /Users/john/.rvm/gems/ruby-2.3.0/gems/dato-0.3.7/lib/dato/local/field_type/image.rb:37:in `to_hash'
dewyze commented 7 years ago

Nevermind, I see that you fixed that here. When I clone the gem and use it, it works fine. So I guess it's just waiting for the next push to rubygems.