diff options
author | Gareth Rees <gareth@mysociety.org> | 2015-06-03 17:35:21 +0100 |
---|---|---|
committer | Gareth Rees <gareth@mysociety.org> | 2015-06-15 16:11:12 +0100 |
commit | ebe263d4791ef5e8efaac505f9d7df24c5538a3a (patch) | |
tree | 8710009cb280e98e7860cf60608c983059596226 | |
parent | 9523b149391eb9601c4a687aa7cfcdaba67dcbfa (diff) |
Privatise PublicBody#set_default_publication_scheme
Only used in a callback
-rw-r--r-- | app/models/public_body.rb | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/app/models/public_body.rb b/app/models/public_body.rb index 9e111be28..9b2a20d82 100644 --- a/app/models/public_body.rb +++ b/app/models/public_body.rb @@ -186,12 +186,6 @@ class PublicBody < ActiveRecord::Base uniq 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) - self.publication_scheme = "" if self.publication_scheme.nil? - end - def set_api_key self.api_key = SecureRandom.base64(33) if self.api_key.nil? end @@ -696,6 +690,21 @@ class PublicBody < ActiveRecord::Base return bodies end + # TODO: This could be removed by updating the default value (to '') of the + # `publication_scheme` column in the `public_body_translations` table. + # + # TODO: Can't actually deprecate this because spec/script/mailin_spec.rb:28 + # fails due to the deprecation notice output + def set_default_publication_scheme + # warn %q([DEPRECATION] PublicBody#set_default_publication_scheme will + # become a private method in 0.23).squish + + # Make sure publication_scheme gets the correct default value. + # (This would work automatically, were publication_scheme not a + # translated attribute) + self.publication_scheme = "" if publication_scheme.nil? + 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 |