From 88bd05133cc3665e05247a6fb80fb56ac0cd0cd0 Mon Sep 17 00:00:00 2001 From: Ryunosuke SATO Date: Sat, 29 Dec 2012 11:56:04 +0900 Subject: [PATCH] Cache host in Settings --- app/models/settings.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/settings.rb b/app/models/settings.rb index 488a03f..b3b68b2 100644 --- a/app/models/settings.rb +++ b/app/models/settings.rb @@ -4,7 +4,7 @@ class Settings < Settingslogic namespace Rails.env def host - if uri.default_port == uri.port + @host ||= if uri.default_port == uri.port uri.host else '%s:%d' % [uri.host, uri.port]