I've got a production server and a staging sever in which new features are tested before moving them to production. The staging server is physically different from the production one (different hosts with different urls), but it mimics it as much as possible (i.e. same packages, same gems, etc).
Rails.env = 'production'
on both servers.
My problem is that in some cases I need different behaviour on staging than in production.
For example, a new feature might send massive emails to users on production; but while I'm testing it I'd rather have them sent to a 'test' email account.
What is the best way to detect the server I'm at?
I'd like to do it as "raily" as possible.
Thanks a lot.