Use inspect when writing the foreign key from the reflection

If we don't use inspect inside the class_eval block then the foreign key
is written without quotes causing us to fetch the foreign key value and
not the column name.