-
-
Notifications
You must be signed in to change notification settings - Fork 197
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[#8365] Add special not_requestable tag #8366
Draft
gbp
wants to merge
1
commit into
develop
Choose a base branch
from
8365-not-requestable
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -68,7 +68,11 @@ def self.admin_title | |
|
||
# Any PublicBody tagged with any of the follow tags won't be returned in the | ||
# batch authority search results or batch category UI | ||
cattr_accessor :batch_excluded_tags, default: %w[not_apply defunct] | ||
cattr_accessor :batch_excluded_tags, default: %w[ | ||
defunct | ||
not_apply | ||
not_requestable | ||
] | ||
|
||
has_many :info_requests, | ||
-> { order(created_at: :desc) }, | ||
|
@@ -352,6 +356,13 @@ def defunct? | |
|
||
scope :not_defunct, -> { without_tag('defunct') } | ||
|
||
# If tagged "not_requestable", then requests can't be made to the authority | ||
def not_requestable? | ||
has_tag?('not_requestable') | ||
end | ||
|
||
scope :requestable, -> { without_tag('not_requestable') } | ||
|
||
# Are all requests to this body under the Environmental Information | ||
# Regulations? | ||
def eir_only? | ||
|
@@ -364,10 +375,12 @@ def site_administration? | |
|
||
# Can an FOI (etc.) request be made to this body? | ||
def is_requestable? | ||
has_request_email? && !defunct? && !not_apply? | ||
has_request_email? && !defunct? && !not_apply? && !not_requestable? | ||
end | ||
|
||
scope :is_requestable, -> { with_request_email.not_defunct.foi_applies } | ||
scope :is_requestable, -> { | ||
with_request_email.not_defunct.foi_applies.requestable | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
with_request_email.not_defunct.foi_applies.without_tag('not_requestable') |
||
} | ||
|
||
# Strict superset of is_requestable? | ||
def is_followupable? | ||
|
@@ -384,6 +397,8 @@ def not_requestable_reason | |
'defunct' | ||
elsif not_apply? | ||
'not_apply' | ||
elsif not_requestable? | ||
'not_requestable' | ||
elsif !has_request_email? | ||
'bad_contact' | ||
else | ||
|
@@ -392,7 +407,7 @@ def not_requestable_reason | |
end | ||
|
||
def special_not_requestable_reason? | ||
defunct? || not_apply? | ||
defunct? || not_apply? || not_requestable? | ||
end | ||
|
||
def created_at_numeric | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not 100% on the phrasing here but don't have an immediate suggestion. @HelenWDTK any thoughts?