Improve checking for Rails