our referer is bust if there is no domain

This commit is contained in:
Sam 2013-07-05 14:07:08 +10:00
parent 64c89316a6
commit f3ac84d41f
1 changed files with 2 additions and 1 deletions

View File

@ -40,7 +40,8 @@ class IncomingLink < ActiveRecord::Base
# Internal: Extract the domain from link.
def extract_domain
if referer.present?
self.domain = URI.parse(referer).host
self.domain = URI.parse(self.referer).host
self.referer = nil unless self.domain
end
end