aboutsummaryrefslogtreecommitdiffstats
path: root/app/models/public_body.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/public_body.rb')
-rw-r--r--app/models/public_body.rb10
1 files changed, 5 insertions, 5 deletions
diff --git a/app/models/public_body.rb b/app/models/public_body.rb
index feec7cdd5..fec1cefb6 100644
--- a/app/models/public_body.rb
+++ b/app/models/public_body.rb
@@ -138,7 +138,7 @@ class PublicBody < ActiveRecord::Base
end
# Set the first letter on a public body or translation
- def PublicBody.set_first_letter(instance)
+ def self.set_first_letter(instance)
unless instance.name.nil? or instance.name.empty?
# we use a regex to ensure it works with utf-8/multi-byte
first_letter = Unicode.upcase instance.name.scan(/^./mu)[0]
@@ -334,7 +334,7 @@ class PublicBody < ActiveRecord::Base
end
# The "internal admin" is a special body for internal use.
- def PublicBody.internal_admin_body
+ def self.internal_admin_body
# Use find_by_sql to avoid the search being specific to a
# locale, since url_name is a translated field:
sql = "SELECT * FROM public_bodies WHERE url_name = 'internal_admin_authority'"
@@ -387,7 +387,7 @@ class PublicBody < ActiveRecord::Base
# matching names won't work afterwards, and we'll create new bodies instead
# of updating them
bodies_by_name = {}
- set_of_existing = Set.new()
+ set_of_existing = Set.new
internal_admin_body_id = PublicBody.internal_admin_body.id
I18n.with_locale(I18n.default_locale) do
bodies = (tag.nil? || tag.empty?) ? PublicBody.find(:all, :include => :translations) : PublicBody.find_by_tag(tag)
@@ -400,7 +400,7 @@ class PublicBody < ActiveRecord::Base
end
end
- set_of_importing = Set.new()
+ set_of_importing = Set.new
# Default values in case no field list is given
field_names = { 'name' => 1, 'request_email' => 2 }
line = 0
@@ -567,7 +567,7 @@ class PublicBody < ActiveRecord::Base
# Return the domain part of an email address, canonicalised and with common
# extra UK Government server name parts removed.
- def PublicBody.extract_domain_from_email(email)
+ def self.extract_domain_from_email(email)
email =~ /@(.*)/
if $1.nil?
return nil