I think following should do:
class Child < ActiveRecord::Base
has_many :relationships
has_many :parents, through: :relationships
has_many :schedules
end
class Parent < ActiveRecord::Base
has_many :relationships
has_many :children, through: :relationships
has_many :schedules
end
class Relationship < ActiveRecord::Base
belongs_to :child
belongs_to :parent
end
class Schedule < ActiveRecord::Base
belongs_to :child
belongs_to :parent
end
EDIT: The above relation is easy to handle because it will give you schedules directly like
child_object.schedules # All schedules of child
parent_object.schedules # All schedules of parent
You can further filter this results by defining scopes in Schedule
model