Skip to content

Commit

Permalink
Change the way we detect documents that were revoked but published an…
Browse files Browse the repository at this point in the history
…yway to decouple the dependency on the previous issue (ensures edge cases in special filings or holidays aren’t an issue).
  • Loading branch information
peregrinator committed Apr 19, 2016
1 parent dce102a commit 591c22b
Showing 1 changed file with 6 additions and 12 deletions.
18 changes: 6 additions & 12 deletions app/presenters/problematic_document_presenter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,6 @@ def documents_scheduled_but_unpublished
end

def revoked_and_published_documents
previous_publication_date = issue.previous.publication_date

revoked_pi_numbers =
PublicInspectionIssue.
find_by_publication_date(previous_publication_date).
public_inspection_documents.
revoked.
map(&:document_number)

published_doc_numbers =
Entry.all(
:conditions => {
Expand All @@ -46,9 +37,12 @@ def revoked_and_published_documents
).
map(&:document_number)

revoked_pi_numbers.
select{|doc_number| published_doc_numbers.include? doc_number}.
map{|doc_number| PublicInspectionDocument.find_by_document_number(doc_number) }
PublicInspectionDocument.all(
:conditions => {
:document_number => published_doc_numbers,
:publication_date => nil
}
)
end

def documents_published_without_public_inspection
Expand Down

0 comments on commit 591c22b

Please sign in to comment.