Query & compose an array

Hi there,

What’s the correct & most efficient way to compose the following array?

I have:

Existing tables:

  • users (:id)
  • user_languages (:id, :user_id, :language_id)
  • languages (:id, :name)

Existing array:


Wanted array: (for a specific user)

@languages” = Languages.find(:all) - (“Languages” whose “:ids” can be
found as “:language_ids” in the existing array “@user_languages”)

Thanks a lot for your help!

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs