aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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