阅读背景:

Rails :: inverse_of和Association扩展

来源:互联网 

I have the following set-up

我有以下设置

class Player < ActiveRecord::Base
  has_many :cards, :inverse_of => :player do
    def in_hand
      find_all_by_location('hand')
    end
  end
end

class Card < ActiveRecord::Base
  belongs_to :player, :inverse_of => :cards
end
class Pl



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: