Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

133
Views
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

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Try something like

ActivityPart.select("activity_json->'image' as image").map(&:image)

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!