aboutsummaryrefslogtreecommitdiffstats
path: root/app/models
diff options
context:
space:
mode:
Diffstat (limited to 'app/models')
-rw-r--r--app/models/profile_photo.rb2
-rw-r--r--app/models/public_body.rb16
2 files changed, 4 insertions, 14 deletions
diff --git a/app/models/profile_photo.rb b/app/models/profile_photo.rb
index 43dbbbf0a..798094d90 100644
--- a/app/models/profile_photo.rb
+++ b/app/models/profile_photo.rb
@@ -17,8 +17,6 @@
#
# $Id: profile_photo.rb,v 1.2 2009-09-17 21:10:05 francis Exp $
#
-require 'mahoro'
-require 'RMagick'
class ProfilePhoto < ActiveRecord::Base
WIDTH = 96
diff --git a/app/models/public_body.rb b/app/models/public_body.rb
index 961fa3cbb..a18af8c69 100644
--- a/app/models/public_body.rb
+++ b/app/models/public_body.rb
@@ -282,19 +282,11 @@ class PublicBody < ActiveRecord::Base
# Guess home page from the request email, or use explicit override, or nil
# if not known.
def calculated_home_page
- # manual override for ones we calculate wrongly
- if self.home_page != ''
- return self.home_page
+ if home_page && !home_page.empty?
+ home_page[URI::regexp(%w(http https))] ? home_page : "http://#{home_page}"
+ elsif request_email_domain
+ "http://www.#{request_email_domain}"
end
-
- # extract the domain name from the FOI request email
- url = self.request_email_domain
- if url.nil?
- return nil
- end
-
- # add standard URL prefix
- return "http://www." + url
end
# Are all requests to this body under the Environmental Information Regulations?