concordia-publishing-house/abstract_importer — pull request #4 by boblail (2014-04-04 20:44:44+00:00)
Title: (wip) Added tests for implementing ID map of polymorphic relationships

### To do

The ID Map preserves the relationships between records in a relational database by remapping foreign keys.

The ID map can return the correct (new) value for a foreign key given two things:
- The foreign table (**dependency**)
- The foreign record's legacy ID (**legacy_id**)

The current implementation assumes that both values are present at "compile time" (when `prepare_mappings!` is called). To support polymorphic relationships, we need to support two scenarios:

1. Both values are present at compile time (when `CollectionImporter#prepare_mappings!` is called)
2. **dependency** is supposed at run time (when `CollectionImporter#remap_foreign_keys!` is called)