'returning just a key from a hash field

I have an ActivityPart model that has a field called activity_json. this field is a hash and has a key named "image". How do I select all "image" from the activity_json field? I did something like this but it didn't work:

x = ActivityPart.all.pluck(activity_json: ['image'])

my idea is to return all 'image' from the activiy_json field



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source