What is best solution for this problem:
I has a Ticket model, that contains source and destination points. Source can be address, train station, airport, each with it own fields (address has city and address fields, train station has train depot and train number fields, etc). Same thing with destination. I need to implement dynamic selection of type of source and destination for ticket.
Rails has an awesome way for it. Its called polymorphic associations. Go through the documentation.