1
如何根据爱好者数量列出索引页面中的所有游戏?感谢Ruby on rails建立关联范围
class Game < ActiveRecord::Base
has_many :reverse_relationships, :dependent => :destroy, :foreign_key => "game_id", :class_name => "Relationship"
has_many :lovers, :through => :reverse_relationships, :source => :user_id
end
感谢,它的工作 –
是否能解决你的问题,PLZ给予好评我的答案;-) – auralbee
对不起, “投票最多需要15声誉” –