Can't you use Rails.env.production? instead? Then you don't need Settings.application.layer at all.