daily pastebin goal
27%
SHARE
TWEET

Untitled

a guest Feb 11th, 2019 53 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. class Item < ActiveRecord::Base
  2.   # assets
  3.   has_many :assets, :as => :assetable, :dependent => :destroy
  4.  
  5. class Asset < ActiveRecord::Base
  6.   belongs_to :assetable, :polymorphic => true
  7.    
  8. a=Asset.find(5)
  9. a.item  # no dice
  10.    
  11. a=Asset.find(5)
  12. a.assetable
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top