Skip to content

Commit

Permalink
Revert "Override old "documents" fields with new "attachments" fields"
Browse files Browse the repository at this point in the history
  • Loading branch information
barrucadu authored Mar 6, 2020
1 parent 8526c5f commit af063d9
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 82 deletions.
16 changes: 3 additions & 13 deletions app/presenters/consultation_presenter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ class ConsultationPresenter < ContentItemPresenter
include ContentItem::Political
include ContentItem::Shareable
include ContentItem::TitleAndContext
include ContentItem::FeaturedAttachmentsMigration

def opening_date_time
content_item["details"]["opening_date"]
Expand Down Expand Up @@ -136,23 +135,14 @@ def ways_to_respond
end

def final_outcome_documents_list
@final_outcome_documents_list ||= choose_field(
new_field_name: "final_outcome_attachments",
old_field_name: "final_outcome_documents",
)
content_item["details"]["final_outcome_documents"] || []
end

def public_feedback_documents_list
@public_feedback_documents_list ||= choose_field(
new_field_name: "public_feedback_attachments",
old_field_name: "public_feedback_documents",
)
content_item["details"]["public_feedback_documents"] || []
end

def documents_list
@documents_list ||= choose_field(
new_field_name: "featured_attachments",
old_field_name: "documents",
)
content_item["details"]["documents"] || []
end
end
23 changes: 0 additions & 23 deletions app/presenters/content_item/featured_attachments_migration.rb

This file was deleted.

6 changes: 1 addition & 5 deletions app/presenters/publication_presenter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ class PublicationPresenter < ContentItemPresenter
include ContentItem::NationalApplicability
include ContentItem::NationalStatisticsLogo
include ContentItem::Political
include ContentItem::FeaturedAttachmentsMigration

def details
content_item["details"]["body"]
Expand All @@ -28,9 +27,6 @@ def dataset?
private

def documents_list
@documents_list ||= choose_field(
new_field_name: "featured_attachments",
old_field_name: "documents",
)
content_item["details"]["documents"]
end
end
41 changes: 0 additions & 41 deletions test/presenters/content_item/featured_attachments_migration.rb

This file was deleted.

0 comments on commit af063d9

Please sign in to comment.