aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGareth Rees <gareth@mysociety.org>2015-06-03 17:33:18 +0100
committerGareth Rees <gareth@mysociety.org>2015-06-15 16:11:11 +0100
commit9523b149391eb9601c4a687aa7cfcdaba67dcbfa (patch)
tree6b33902d568b6e168a2f8a5992da4e35699d6176
parentf44bcb39c2c25a3d41f433ac7fbf714e722ba418 (diff)
Deprecate PublicBody.set_first_letter
Unused since 1524f83baa3b93a506dbefe7def0c4c304f93745
-rw-r--r--app/models/public_body.rb27
1 files changed, 14 insertions, 13 deletions
diff --git a/app/models/public_body.rb b/app/models/public_body.rb
index 0a394dadf..9e111be28 100644
--- a/app/models/public_body.rb
+++ b/app/models/public_body.rb
@@ -186,17 +186,6 @@ class PublicBody < ActiveRecord::Base
uniq
end
- # Set the first letter on a public body or translation
- 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]
- if first_letter != instance.first_letter
- instance.first_letter = first_letter
- end
- end
- end
-
def set_default_publication_scheme
# Make sure publication_scheme gets the correct default value.
# (This would work automatically, were publication_scheme not a translated attribute)
@@ -232,8 +221,6 @@ class PublicBody < ActiveRecord::Base
PublicBody.find(old.first)
end
-
-
# If tagged "not_apply", then FOI/EIR no longer applies to authority at all
def not_apply?
return self.has_tag?('not_apply')
@@ -709,6 +696,20 @@ class PublicBody < ActiveRecord::Base
return bodies
end
+ # Set the first letter on a public body or translation
+ def self.set_first_letter(instance)
+ warn %q([DEPRECATION] PublicBody.set_first_letter will be removed
+ in 0.23).squish
+
+ 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]
+ if first_letter != instance.first_letter
+ instance.first_letter = first_letter
+ end
+ end
+ end
+
def calculate_cached_fields(t)
warn %q([DEPRECATION] PublicBody#calculate_cached_fields will be removed
in 0.23).squish