Check for Rails::Engine
Add check for Rails.application