Rails engine check

Checks for `Rails::Engine` and `Rails.application` instead of just `Rails` in a couple of places.

Does what #45 would have done if it hadn't gotten closed without getting merged.