cirandas.net

ref: master

plugins/products/lib/ext/profile.rb


 1
 2
 3
 4
 5
 6
 7
 8
 9
10
require_dependency 'profile'

class Profile

  has_many :products, foreign_key: :profile_id, dependent: :destroy, class_name: 'ProductsPlugin::Product'
  has_many :product_categories, through: :products, class_name: 'ProductsPlugin::ProductCategory'
  has_many :inputs, through: :products, class_name: 'ProductsPlugin::Input'
  has_many :production_costs, as: :owner, class_name: 'ProductsPlugin::ProductionCost'

end