views:

33

answers:

0

Currently I have several models set up like so,

class Account < ActiveRecord::Base
  has_many :office_hours
  has_many :staff_positions
end

class OfficeHour < ActiveRecord::Base
  belongs_to :account
end

class StaffPosition < ActiveRecord::Base
  belongs_to :account
end

class Document < ActiveRecord::Base
end

Now I need to set up a many-to-many association between OfficeHour and StaffPosition to Document, so that several staff positions and office hours could be assigned to many documents. In the problem domain staff positions and office hours are referred to as making up the account information, but there is no AccountInformation object currently in the application. What is the best way to join these models together?