Rails:批量获取has_many关联中所有对象的最后一条记录
Context for My Question
Hey everyone, I’ve spent roughly 30 hours on-and-off searching for a solution to my problem, but I haven’t been able to find anything that gives me the result I’m expecting. Instead of wasting more time digging around, I decided to ask here on Stack Overflow.
Here’s the relevant model code to help you understand the scenario I’m working with:
class Employee < ApplicationRecord has_many :employee_locations has_many :countries, through: :employee_locations end
内容的提问来源于stack exchange,提问作者Miko Uy Dagatan
相关产品推荐
相关产品推荐

