Support indices in Rails engines

Fixes #465