I have a model A that has many of another model B, which has_many of a third model C, and want to delegate A from B to C. For example:
class House < ApplicationRecord
has_many :pets
end
class Pet < ApplicationRecord
belongs_to :house
has_many :toys
delegate :house, to: :toys
end
class Toy < ApplicationRecord
belongs_to :pet
end
> toy.house
As it stands, I have to use toy.pet.house