contentful-management.rb icon indicating copy to clipboard operation
contentful-management.rb copied to clipboard

Why is there nothing working in this gem?

Open paul-mesnilgrente opened this issue 3 years ago • 2 comments

I'm trying some very simple stuff like:

entry.published_at_with_locales['en-NZ'] = DateTime.parse(data['published_at'])
# or even
entry.published_at_with_locales =   {'en-NZ' => DateTime.parse(data['published_at'])}

# no errors!

But it's not working, when I run

entry.published_at_with_locales
# gives nil!

How simple should this be?

paul-mesnilgrente avatar Nov 18 '21 13:11 paul-mesnilgrente

@paul-mesnilgrente As mentioned in documentation you need to save entry entry.save after updating it to reflect the changes.

Trying the following might resolve your issue.

entry.published_at_with_locales['en-NZ'] = DateTime.parse(data['published_at'])
entry.save

Let me know if the fix works.

Cheers

rubydog avatar Nov 20 '21 04:11 rubydog

I tried that but the result is the same :/

paul-mesnilgrente avatar Nov 22 '21 12:11 paul-mesnilgrente