Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/future_proof.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ jobs:
# by adding the following line, but this didn't help with github actions
# # environment.config.set('output.hashFunction', 'sha256')
# https://stackoverflow.com/questions/69692842/error-message-error0308010cdigital-envelope-routinesunsupported/73465262#73465262
run: NODE_OPTIONS=--openssl-legacy-provider RAILS_GROUPS=assets RAILS_ENV=test bin/rails assets:clobber assets:precompile
run: NODE_OPTIONS=--openssl-legacy-provider RAILS_GROUPS=assets RAILS_ENV=test bin/rails yarn:install assets:clobber assets:precompile
- name: Run smoke tests with latest gems and ruby
run: bin/rake smoke_test

Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ jobs:
- uses: actions/checkout@v2
with:
fetch-depth: 0 # fetch everything
- name: Remove mini_racer CentOS 7 shim from Gemfile.lock
run: sed -i.bak -e '/mini_racer ([0-9.]*-x86_64-linux)/,+1d' Gemfile.lock
- name: Set up Ruby + Bundle
uses: ruby/setup-ruby@v1
with:
Expand Down
10 changes: 1 addition & 9 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,6 @@ jobs:

steps:
- uses: actions/checkout@v2
- name: Remove mini_racer CentOS 7 shim from Gemfile.lock
run: sed -i.bak -e '/mini_racer ([0-9.]*-x86_64-linux)/,+1d' Gemfile.lock
- name: Remove tests confirming mini_racer CentOS 7 shim in Gemfile.lock
run: rm -f test/lib/gemfile_test.rb
- name: Set up Ruby + Bundle
uses: ruby/setup-ruby@v1
with:
Expand All @@ -59,7 +55,7 @@ jobs:
# by adding the following line, but this didn't help with github actions
# # environment.config.set('output.hashFunction', 'sha256')
# https://stackoverflow.com/questions/69692842/error-message-error0308010cdigital-envelope-routinesunsupported/73465262#73465262
run: NODE_OPTIONS=--openssl-legacy-provider bin/rails assets:precompile
run: NODE_OPTIONS=--openssl-legacy-provider bin/rails yarn:install assets:clobber assets:precompile
- name: Run tests
run: bin/rails test

Expand All @@ -68,8 +64,6 @@ jobs:

steps:
- uses: actions/checkout@v2
- name: Remove mini_racer CentOS 7 shim from Gemfile.lock
run: sed -i.bak -e '/mini_racer ([0-9.]*-x86_64-linux)/,+1d' Gemfile.lock
- name: Set up Ruby + Bundle
uses: ruby/setup-ruby@v1
with:
Expand All @@ -82,8 +76,6 @@ jobs:

steps:
- uses: actions/checkout@v2
- name: Remove mini_racer CentOS 7 shim from Gemfile.lock
run: sed -i.bak -e '/mini_racer ([0-9.]*-x86_64-linux)/,+1d' Gemfile.lock
- name: Set up Ruby + Bundle
uses: ruby/setup-ruby@v1
with:
Expand Down
10 changes: 8 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
source 'https://rubygems.org'

gem 'activemodel-caution', '6.1.7.6' # Supports rails ~> 6.1.7.0
gem 'rails', '~> 6.1.0', '>= 6.1.7.5'
# The activemodel-cautions gem is ours, so not available rubygems.org.
# The .gem file is in vendor/cache - if this is lost, or the gem needs
# updating, the source (along with development instructions in the
# README) is available at:
# https://github.com/NHSDigital/activemodel-caution.git

gem 'activemodel-caution', '7.0.8' # Supports rails ~> 7.0.8.0
gem 'rails', '~> 7.0.4', '>= 7.0.8.1'

# Use old psych for YAML on Ruby 3.1 until we move to Rails 7.0.4
# so that we can continue to use aliases in config/locales/en.yml
Expand Down
143 changes: 75 additions & 68 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -10,71 +10,77 @@ GEM
remote: https://rubygems.org/
specs:
Ascii85 (1.1.0)
actioncable (6.1.7.10)
actionpack (= 6.1.7.10)
activesupport (= 6.1.7.10)
actioncable (7.0.8.6)
actionpack (= 7.0.8.6)
activesupport (= 7.0.8.6)
nio4r (~> 2.0)
websocket-driver (>= 0.6.1)
actionmailbox (6.1.7.10)
actionpack (= 6.1.7.10)
activejob (= 6.1.7.10)
activerecord (= 6.1.7.10)
activestorage (= 6.1.7.10)
activesupport (= 6.1.7.10)
actionmailbox (7.0.8.6)
actionpack (= 7.0.8.6)
activejob (= 7.0.8.6)
activerecord (= 7.0.8.6)
activestorage (= 7.0.8.6)
activesupport (= 7.0.8.6)
mail (>= 2.7.1)
actionmailer (6.1.7.10)
actionpack (= 6.1.7.10)
actionview (= 6.1.7.10)
activejob (= 6.1.7.10)
activesupport (= 6.1.7.10)
net-imap
net-pop
net-smtp
actionmailer (7.0.8.6)
actionpack (= 7.0.8.6)
actionview (= 7.0.8.6)
activejob (= 7.0.8.6)
activesupport (= 7.0.8.6)
mail (~> 2.5, >= 2.5.4)
net-imap
net-pop
net-smtp
rails-dom-testing (~> 2.0)
actionpack (6.1.7.10)
actionview (= 6.1.7.10)
activesupport (= 6.1.7.10)
rack (~> 2.0, >= 2.0.9)
actionpack (7.0.8.6)
actionview (= 7.0.8.6)
activesupport (= 7.0.8.6)
rack (~> 2.0, >= 2.2.4)
rack-test (>= 0.6.3)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.2.0)
actiontext (6.1.7.10)
actionpack (= 6.1.7.10)
activerecord (= 6.1.7.10)
activestorage (= 6.1.7.10)
activesupport (= 6.1.7.10)
actiontext (7.0.8.6)
actionpack (= 7.0.8.6)
activerecord (= 7.0.8.6)
activestorage (= 7.0.8.6)
activesupport (= 7.0.8.6)
globalid (>= 0.6.0)
nokogiri (>= 1.8.5)
actionview (6.1.7.10)
activesupport (= 6.1.7.10)
actionview (7.0.8.6)
activesupport (= 7.0.8.6)
builder (~> 3.1)
erubi (~> 1.4)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.1, >= 1.2.0)
activejob (6.1.7.10)
activesupport (= 6.1.7.10)
activejob (7.0.8.6)
activesupport (= 7.0.8.6)
globalid (>= 0.3.6)
activemodel (6.1.7.10)
activesupport (= 6.1.7.10)
activemodel-caution (6.1.7.6)
actionpack (~> 6.1.7.0)
activemodel (~> 6.1.7.0)
activerecord (~> 6.1.7.0)
activesupport (~> 6.1.7.0)
railties (~> 6.1.7.0)
activerecord (6.1.7.10)
activemodel (= 6.1.7.10)
activesupport (= 6.1.7.10)
activestorage (6.1.7.10)
actionpack (= 6.1.7.10)
activejob (= 6.1.7.10)
activerecord (= 6.1.7.10)
activesupport (= 6.1.7.10)
activemodel (7.0.8.6)
activesupport (= 7.0.8.6)
activemodel-caution (7.0.8.0)
actionpack (~> 7.0.8.0)
activemodel (~> 7.0.8.0)
activerecord (~> 7.0.8.0)
activesupport (~> 7.0.8.0)
railties (~> 7.0.8.0)
activerecord (7.0.8.6)
activemodel (= 7.0.8.6)
activesupport (= 7.0.8.6)
activestorage (7.0.8.6)
actionpack (= 7.0.8.6)
activejob (= 7.0.8.6)
activerecord (= 7.0.8.6)
activesupport (= 7.0.8.6)
marcel (~> 1.0)
mini_mime (>= 1.1.0)
activesupport (6.1.7.10)
activesupport (7.0.8.6)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 1.6, < 2)
minitest (>= 5.1)
tzinfo (~> 2.0)
zeitwerk (~> 2.3)
addressable (2.8.5)
public_suffix (>= 2.0.2, < 6.0)
afm (0.2.2)
Expand All @@ -91,7 +97,8 @@ GEM
autoprefixer-rails (>= 5.2.1)
sassc (>= 2.0.0)
bootstrap-table-rails (1.20.2)
brakeman (5.0.4)
brakeman (6.2.2)
racc
builder (3.2.4)
bundler-audit (0.9.1)
bundler (>= 1.2.0, < 3)
Expand Down Expand Up @@ -292,9 +299,9 @@ GEM
spreadsheet (= 1.2.6)
ndr_pseudonymise (0.4.2)
activesupport
ndr_support (5.9.4)
activerecord (>= 6.1, < 7.1)
activesupport (>= 6.1, < 7.1)
ndr_support (5.10.3)
activerecord (>= 6.1, < 7.2)
activesupport (>= 6.1, < 7.2)
ndr_ui (3.3.1)
bootstrap-sass (~> 3.4.1)
jquery-rails (>= 4.1.0)
Expand Down Expand Up @@ -381,34 +388,34 @@ GEM
rack-test (2.1.0)
rack (>= 1.3)
railroady (1.6.0)
rails (6.1.7.10)
actioncable (= 6.1.7.10)
actionmailbox (= 6.1.7.10)
actionmailer (= 6.1.7.10)
actionpack (= 6.1.7.10)
actiontext (= 6.1.7.10)
actionview (= 6.1.7.10)
activejob (= 6.1.7.10)
activemodel (= 6.1.7.10)
activerecord (= 6.1.7.10)
activestorage (= 6.1.7.10)
activesupport (= 6.1.7.10)
rails (7.0.8.6)
actioncable (= 7.0.8.6)
actionmailbox (= 7.0.8.6)
actionmailer (= 7.0.8.6)
actionpack (= 7.0.8.6)
actiontext (= 7.0.8.6)
actionview (= 7.0.8.6)
activejob (= 7.0.8.6)
activemodel (= 7.0.8.6)
activerecord (= 7.0.8.6)
activestorage (= 7.0.8.6)
activesupport (= 7.0.8.6)
bundler (>= 1.15.0)
railties (= 6.1.7.10)
sprockets-rails (>= 2.0.0)
railties (= 7.0.8.6)
rails-dom-testing (2.2.0)
activesupport (>= 5.0.0)
minitest
nokogiri (>= 1.6)
rails-html-sanitizer (1.6.0)
loofah (~> 2.21)
nokogiri (~> 1.14)
railties (6.1.7.10)
actionpack (= 6.1.7.10)
activesupport (= 6.1.7.10)
railties (7.0.8.6)
actionpack (= 7.0.8.6)
activesupport (= 7.0.8.6)
method_source
rake (>= 12.2)
thor (~> 1.0)
zeitwerk (~> 2.5)
rainbow (3.1.1)
rake (13.0.6)
rb-fsevent (0.11.2)
Expand Down Expand Up @@ -538,7 +545,7 @@ PLATFORMS
x86_64-linux

DEPENDENCIES
activemodel-caution (= 6.1.7.6)
activemodel-caution (= 7.0.8)
bootstrap-table-rails (~> 1.20.2)
byebug
cancancan (~> 3.0)
Expand Down Expand Up @@ -586,7 +593,7 @@ DEPENDENCIES
puma-daemon
rack-mini-profiler
railroady
rails (~> 6.1.0, >= 6.1.7.5)
rails (~> 7.0.4, >= 7.0.8.1)
rainbow
regexp-examples
sass-rails
Expand Down
2 changes: 1 addition & 1 deletion app/models/report/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def each(**options, &block)
end

def to_csv
to_csv_enum.sum
to_csv_enum.sum('')
end

# Allow downloads to be streamed back as they're generated:
Expand Down
2 changes: 1 addition & 1 deletion app/validators/date_validator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def comparative_value(comparative_option, record)
def comparative_name(comparative_option, record)
case comparative_option
when Date, Proc
comparative_value(comparative_option, record).try(:to_s, :ui)
comparative_value(comparative_option, record).try(:to_fs, :ui)
when Symbol
record.class.human_attribute_name(comparative_option)
else
Expand Down
2 changes: 1 addition & 1 deletion app/views/comments/_comment.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<div class="media-body comment--body">
<div class="media-heading comment--heading">
<strong><%= comment.user_full_name %></strong><br />
<small><em><%= comment.created_at.to_s(:ui_with_time) %></em></small><br />
<small><em><%= comment.created_at.to_fs(:ui_with_time) %></em></small><br />

<% comment.tags.each do |tag| %>
<span class="label label-info"><%= tag %></span>
Expand Down
2 changes: 1 addition & 1 deletion app/views/communications/_communication.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<td><%= communication.id %></td>
<td><%= communication.sender_full_name %></td>
<td><%= communication.recipient_full_name %></td>
<td><%= communication.contacted_at.to_s(:ui) %></td>
<td><%= communication.contacted_at.to_fs(:ui) %></td>
<td><%= communication.medium.titleize %></td>
<td><%= "re: #{communication.parent_id}" if communication.parent_id %></td>
<td class="text-right">
Expand Down
2 changes: 1 addition & 1 deletion app/views/jobs/_row.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<td><span class="label label-primary"><%= job.queue %><span></td>
<td><%= job_status(job) %></td>
<td><%= job.attempts %></td>
<td><%= job.run_at.to_s(:db) %></td>
<td><%= job.run_at.to_fs(:db) %></td>
<td><code><%= job_data['job_class'] %></code></td>
<td><code><%= job_data['job_id'] %></code></td>
<td>
Expand Down
10 changes: 5 additions & 5 deletions app/views/jobs/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,20 @@
<dt><%= Delayed::Job.human_attribute_name(:status) %></dt>
<dd><%= job_status(@job) %></dd>
<dt><%= Delayed::Job.human_attribute_name(:created_at) %></dt>
<dd><%= @job.created_at.to_s(:db) %></dd>
<dd><%= @job.created_at.to_fs(:db) %></dd>
<dt><%= Delayed::Job.human_attribute_name(:updated_at) %></dt>
<dd><%= @job.updated_at.to_s(:db) %></dd>
<dd><%= @job.updated_at.to_fs(:db) %></dd>
</dl>
</div>
<div class="col-md-6">
<dl class="dl-horizontal">

<dt><%= Delayed::Job.human_attribute_name(:run_at) %></dt>
<dd><%= @job.run_at.to_s(:db) %></dd>
<dd><%= @job.run_at.to_fs(:db) %></dd>
<dt><%= Delayed::Job.human_attribute_name(:failed_at) %></dt>
<dd><%= @job.failed_at&.to_s(:db) %></dd>
<dd><%= @job.failed_at&.to_fs(:db) %></dd>
<dt><%= Delayed::Job.human_attribute_name(:locked_at) %></dt>
<dd><%= @job.locked_at&.to_s(:db) %></dd>
<dd><%= @job.locked_at&.to_fs(:db) %></dd>
<dt><%= Delayed::Job.human_attribute_name(:locked_by) %></dt>
<dd><%= @job.locked_by %></dd>
</dl>
Expand Down
4 changes: 2 additions & 2 deletions app/views/projects/_contracts.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
<td><%= contract.referent_reference %></td>
<td><%= contract.reference %></td>
<td><%= contract.contract_version %></td>
<td><%= contract.contract_start_date&.to_s(:ui) %></td>
<td><%= contract.contract_end_date&.to_s(:ui) %></td>
<td><%= contract.contract_start_date&.to_fs(:ui) %></td>
<td><%= contract.contract_end_date&.to_fs(:ui) %></td>
<td>
<div class="pull-right">
<%= inline_controls_for(contract) %>
Expand Down
6 changes: 3 additions & 3 deletions app/views/projects/_dpias.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@
<td><%= dpia.reference %></td>
<td><%= dpia.ig_toolkit_version %></td>
<td><%= dpia.ig_assessment_status_value %></td>
<td><%= dpia.review_meeting_date&.to_s(:ui) %></td>
<td><%= dpia.dpia_decision_date&.to_s(:ui) %></td>
<td id='dpia_attached_date'><%= dpia&.attachment&.created_at&.to_s(:ui) %></td>
<td><%= dpia.review_meeting_date&.to_fs(:ui) %></td>
<td><%= dpia.dpia_decision_date&.to_fs(:ui) %></td>
<td id='dpia_attached_date'><%= dpia&.attachment&.created_at&.to_fs(:ui) %></td>
<td>
<div class="pull-right">
<%= inline_controls_for(dpia) %>
Expand Down
4 changes: 2 additions & 2 deletions app/views/projects/_project_amendments.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
<% project.project_amendments.accessible_by(current_ability).find_each do |amendment| %>
<%= content_tag(:tr, id: dom_id(amendment)) do %>
<td><%= amendment.reference %></td>
<td><%= amendment.requested_at.to_s(:ui) %></td>
<td><%= amendment.amendment_approved_date&.to_s(:ui) %></td>
<td><%= amendment.requested_at.to_fs(:ui) %></td>
<td><%= amendment.amendment_approved_date&.to_fs(:ui) %></td>
<td>
<% amendment.labels.each do |label| %>
<%= bootstrap_label_tag(:default, label) %>
Expand Down
Loading
Loading