Rails polymorphic has_many :through

前端 未结 1 1041
耶瑟儿~
耶瑟儿~ 2020-12-08 22:44

I\'m pulling some data from an external API and would like to cache the results locally. I have a class SearchTerm, which I would like to be associated with a f

相关标签:
1条回答
  • 2020-12-08 23:16

    You need to add has_many :searchable_items association to Foo, Bar and SearchTerm models because :through => :searchable_items option refers to that association.

    http://guides.rubyonrails.org/association_basics.html#the-has_many-through-association

    0 讨论(0)
提交回复
热议问题