Relative Content

Tag Archive for ruby-on-railspostgresqlactiverecord

Rails Active Record query joins and merge get Ids

User -> Has many cats Vaccinations -> has many cats Cat -> Belongs to vaccination This is what I have tried so far User::CatRecords.joins(cat: :vaccinations).merge(Cat.vaccinated) What I am trying to achieve is get ids of all the cats in the query above. How can I do it? TIA ruby-on-rails postgresql activerecord