refactor key to relation
add tests for quoted strings and polymorphic relations