In a Rails Model, I want to be able to find out the host and port. For example, if I am in a test environment it would return http://localhost:3000/ and if I
http://localhost:3000/
You can get those values in your controllers (request.host, request.port etc.).
You'd have to give that to your models via parameters as the request object is only available in the controllers.