Avoid explicit reloading of association

前端 未结 0 824
终归单人心
终归单人心 2020-12-18 06:55

I have the following models:

class Model < ApplicationRecord
  has_many :states
  has_one :state, -> { order(created_at: :desc) }, class_name: \'State\'         


        
相关标签:
回答
  • 消灭零回复
提交回复
热议问题