我有以下内容:
class Item < ActiveRecord::Base
# assets
has_many :assets, :as => :assetable, :dependent => :destroy
class Asset < ActiveRecord::Base
belongs_to :assetable, :polymorphic => true
并希望能够做到:
a=Asset.find(5)
a.item # no dice
我将如何获得以资产开头的关联项目?
谢谢