Joined March 2015
·
None

Benjamin Bremond

sydney
·
·

Why not simply do


class Person < ActiveRecord::Base
  # Every computer that person has access to
  has_many :accounts
  has_many :computers, :through => :accounts

  # Only comps that this account can administrate
  has_many :administrator_accounts, -> { administrators }, class_name: 'Account'
  has_many :administrated_computers, :through => :administrator_accounts, :source => :computer
end
Achievements
1 Karma
0 Total ProTip Views