generated from dxw/rails-template
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
27 changed files
with
341 additions
and
71 deletions.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
class Import::Csv::ImportedRow | ||
attr_reader :csv_row_number, :object | ||
|
||
def initialize(index, object) | ||
@csv_row_number = index + 2 | ||
@object = object | ||
end | ||
end |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
%table.govuk-table#actuals | ||
%caption.govuk-table__caption.govuk-table__caption--m | ||
Actuals | ||
%thead.govuk-table__head | ||
%tr.govuk-table__row | ||
%th.govuk-table__header{class: "govuk-!-width-one-third", scope: "col"} Activity | ||
%th.govuk-table__header{class: "govuk-!-width-one-third", scope: "col"} RODA Identifier | ||
%th.govuk-table__header{class: "govuk-!-width-one-third", scope: "col"} Value | ||
%tbody.govuk-table__body | ||
- @grouped_actuals.each do |activity, actuals| | ||
%tr.govuk-table__row{ id: "activity_actuals_#{activity.id}" } | ||
%td.govuk-table__cell{class: "govuk-!-width-one-third"} | ||
= activity.title | ||
%td.govuk-table__cell{class: "govuk-!-width-one-third"} | ||
= activity.roda_identifier | ||
%td.govuk-table__cell{class: "govuk-!-width-one-third"} | ||
%table.govuk-table.actuals | ||
- actuals.each do |actual| | ||
%tr.govuk-table__row | ||
%td.govuk-table__cell--numeric{class: "govuk-!-width-one-half", scope: "col"} | ||
= actual.financial_quarter_and_year | ||
%td.govuk-table__cell--numeric{class: "govuk-!-width-one-half", scope: "col"} | ||
= actual.value | ||
- if actual.comment | ||
%tr.govuk-table__row | ||
%td.govuk-table__cell--numeric{class: "govuk-!-width-full", scope: "col", colspan: 2} | ||
= actual.comment.body | ||
|
||
|
||
%tr.govuk-table__row.totals | ||
%td.govuk-table__cell Total | ||
%td.govuk-table__cell | ||
%td.govuk-table__cell.govuk-table__cell--numeric | ||
= @total_actuals |
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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
%table.govuk-table#comments | ||
%caption.govuk-table__caption.govuk-table__caption--m | ||
Activity Comments | ||
%thead.govuk-table__head | ||
%tr.govuk-table__row | ||
%th.govuk-table__header{class: "govuk-!-width-one-third", scope: "col"} Activity | ||
%th.govuk-table__header{class: "govuk-!-width-one-third", scope: "col"} RODA Identifier | ||
%th.govuk-table__header{class: "govuk-!-width-one-third", scope: "col"} Comment | ||
%tbody.govuk-table__body | ||
- @imported_activity_comments.each do |comment| | ||
%tr.govuk-table__row{ id: "activity_comment_#{comment.id}" } | ||
%td.govuk-table__cell{class: "govuk-!-width-one-third"} | ||
= comment.associated_activity.title | ||
%td.govuk-table__cell{class: "govuk-!-width-one-third"} | ||
= comment.associated_activity.roda_identifier | ||
%td.govuk-table__cell{class: "govuk-!-width-one-third"} | ||
= comment.body |
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 |
---|---|---|
@@ -0,0 +1,35 @@ | ||
%table.govuk-table#refunds | ||
%caption.govuk-table__caption.govuk-table__caption--m | ||
Refunds | ||
%thead.govuk-table__head | ||
%tr.govuk-table__row | ||
%th.govuk-table__header{class: "govuk-!-width-one-third", scope: "col"} Activity | ||
%th.govuk-table__header{class: "govuk-!-width-one-third", scope: "col"} RODA Identifier | ||
%th.govuk-table__header{class: "govuk-!-width-one-third", scope: "col"} Value | ||
%tbody.govuk-table__body | ||
- @grouped_refunds.each do |activity, refunds| | ||
%tr.govuk-table__row{ id: "activity_actuals_#{activity.id}" } | ||
%td.govuk-table__cell{class: "govuk-!-width-one-third"} | ||
= activity.title | ||
%td.govuk-table__cell{class: "govuk-!-width-one-third"} | ||
= activity.roda_identifier | ||
%td.govuk-table__cell{class: "govuk-!-width-one-third"} | ||
%table.govuk-table.actuals | ||
- refunds.each do |refund| | ||
%tr.govuk-table__row | ||
%td.govuk-table__cell--numeric{class: "govuk-!-width-one-half", scope: "col"} | ||
= refund.financial_quarter_and_year | ||
%td.govuk-table__cell--numeric{class: "govuk-!-width-one-half", scope: "col"} | ||
= refund.value | ||
- if refund.comment | ||
%tr.govuk-table__row | ||
%td.govuk-table__cell--numeric{class: "govuk-!-width-full", scope: "col", colspan: 2} | ||
= refund.comment.body | ||
|
||
%tr.govuk-table__row.totals | ||
%td.govuk-table__cell Total | ||
%td.govuk-table__cell | ||
%td.govuk-table__cell.govuk-table__cell--numeric | ||
= @total_refunds |
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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
%table.govuk-table#skipped | ||
%caption.govuk-table__caption.govuk-table__caption--m | ||
Skipped rows | ||
%thead.govuk-table__head | ||
%tr.govuk-table__row | ||
%th.govuk-table__header{class: "govuk-!-width-one-third", scope: "col"} Row number | ||
%th.govuk-table__header{class: "govuk-!-width-two-thirds", scope: "col"} RODA Identifier | ||
%tbody.govuk-table__body | ||
- @skipped_rows.each do |row| | ||
%tr.govuk-table__row{ id: "skipped-row-#{row.csv_row_number}" } | ||
%td.govuk-table__cell{class: "govuk-!-width-one-third"} | ||
= row.csv_row_number | ||
%td.govuk-table__cell{class: "govuk-!-width-two-thirds"} | ||
= row.object.roda_identifier |
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
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 |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# Run me with `rails runner db/data/20240123152048_change_beis_to_dsit.rb` | ||
|
||
service_owner = Organisation.where(iati_reference: ["GB-GOV-13", "GB-GOV-26"]).first | ||
if service_owner | ||
service_owner.iati_reference = "GB-GOV-26" | ||
service_owner.name = "DEPARTMENT FOR SCIENCE, INNOVATION AND TECHNOLOGY" | ||
service_owner.beis_organisation_reference = "DSIT" | ||
service_owner.alternate_names = [ | ||
"DEPARTMENT FOR SCIENCE, INNOVATION & TECHNOLOGY", | ||
"Department for Science, Innovation and Technology", | ||
"Department for Science, Innovation & Technology" | ||
] | ||
|
||
unless service_owner.save | ||
puts "Failed to save the changes to #{service_owner.name}: #{service_owner.errors.messages.inspect}" | ||
end | ||
end | ||
|
||
finance = Organisation.where(iati_reference: "GB-GOV-13-OPERATIONS").first | ||
if finance | ||
finance.iati_reference = "GB-GOV-26-OPERATIONS" | ||
finance.name = "DSIT FINANCE" | ||
finance.beis_organisation_reference = "DF" | ||
|
||
unless finance.save | ||
puts "Failed to save the changes to #{finance.name}: #{finance.errors.messages.inspect}" | ||
end | ||
end |
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.