diff options
author | Gareth Rees <gareth@mysociety.org> | 2015-06-03 18:00:56 +0100 |
---|---|---|
committer | Gareth Rees <gareth@mysociety.org> | 2015-06-15 16:11:13 +0100 |
commit | 546f60295da780dfe0e6fa85b918d39c47852322 (patch) | |
tree | 9899232266c4b5ea05f16e03faa4e0f5e3515614 | |
parent | c442a780f98bb698ce0d2d8202d36ced7cf48af4 (diff) |
Group similar methods
-rw-r--r-- | app/models/public_body.rb | 37 |
1 files changed, 19 insertions, 18 deletions
diff --git a/app/models/public_body.rb b/app/models/public_body.rb index 61e293918..50677f892 100644 --- a/app/models/public_body.rb +++ b/app/models/public_body.rb @@ -229,6 +229,21 @@ class PublicBody < ActiveRecord::Base has_tag?('defunct') end + # Are all requests to this body under the Environmental Information + # Regulations? + def eir_only? + has_tag?('eir_only') + end + + # Schools are allowed more time in holidays, so we change some wordings + def is_school? + has_tag?('school') + end + + def site_administration? + has_tag?('site_administration') + end + # Can an FOI (etc.) request be made to this body? def is_requestable? has_request_email? && !defunct? && !not_apply? @@ -269,6 +284,10 @@ class PublicBody < ActiveRecord::Base "authority" end + def law_only_short + eir_only? ? 'EIR' : 'FOI' + end + # Guess home page from the request email, or use explicit override, or nil # if not known. def calculated_home_page @@ -279,24 +298,6 @@ class PublicBody < ActiveRecord::Base end end - # Are all requests to this body under the Environmental Information Regulations? - def eir_only? - has_tag?('eir_only') - end - - def law_only_short - eir_only? ? 'EIR' : 'FOI' - end - - # Schools are allowed more time in holidays, so we change some wordings - def is_school? - has_tag?('school') - end - - def site_administration? - has_tag?('site_administration') - end - # The "internal admin" is a special body for internal use. def self.internal_admin_body # Use find_by_sql to avoid the search being specific to a |