Here are my two models:
Collection:
class Collection < ActiveRecord::Base
has_many :children, class_name: "Collection", foreign_key: "parent_id"
belongs_to :parent, class_name: "Collection", foreign_key: "parent_id", optional: true
has_many :albums, dependent: :nullify
end
Album:
class Album < ActiveRecord::Base
belongs_to :collection, optional: true
has_many :photos, dependent: :destroy
end
I need a way to find all Albums and/or Collections within a parent Collection.
Any ideas as to how I can accomplish this?
This will allow me to access a list of all the photos within a parent Collection etc.