I have a following model structure. I have an Itinerary that has many itinerary nodes. Each itinerary node is a wrapper around either a place, hotel, activity etc. So for example.
Itinerary = "Trip to Paris" Itinerary.itinerary_nodes = [Node1, Node2, Node3] where Node1 = "JFK Airport" Node2 = "CDG Airport" Node3 = "Eiffel Tower"
So essentially nodes represents the places you will visit in your itinerary. In my model structure; lets assume that my airports are modeled different from monuments or hotels. Now I want to create a association such that;
class ItineraryNode
include Mongoid::Document
has_one :stopover
end
Where each stopover can be a different object. It's type and id is stored by default and is later inflated using that.
So how do I declare multiple models to be associated to ItineraryMode? I can implement this specifically by ensuring that I set these attributes manually in initializer; but curious if something like this is supported by default.
Cheers