Skip to content

Commit

Permalink
Fix deprecation warnings
Browse files Browse the repository at this point in the history
- Errors no longer accept two arguments, this commit fixes this deprecation warning:
You are passing a block expecting two parameters, so the old hash behavior is simulated. As this is deprecated,
this will result in an ArgumentError in Rails 6.2. (called from views/planning_applications/recommendation_form.html.erb:16)
.DEPRECATION WARNING: Enumerating ActiveModel::Errors as a hash has been deprecated.
- Rendering actions with '.' in the name is deprecated so all partials with .html or .json now have the simplified naming convention
- raise_on_missing_translations has been replaced with i18n_raise_on_missing_translations due to deprecation
- host! has been deprecated with no replacement - the only place where we don't get any deprecation warnings is in the "request" setting in rails helper, where we do need it or all api requests fail.
I could not find an alternative to host! that would force the GET URI to not have www and since no warnings appear it seemed ok to keep.
  • Loading branch information
melzreal committed Mar 11, 2021
1 parent 893076b commit b0c83c2
Show file tree
Hide file tree
Showing 18 changed files with 102 additions and 114 deletions.
88 changes: 45 additions & 43 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ GEM
activerecord (6.1.3)
activemodel (= 6.1.3)
activesupport (= 6.1.3)
activerecord-postgis-adapter (6.0.1)
activerecord (~> 6.0)
rgeo-activerecord (~> 6.0)
activerecord-postgis-adapter (7.0.1)
activerecord (~> 6.1)
rgeo-activerecord (~> 7.0.0)
activestorage (6.1.3)
actionpack (= 6.1.3)
activejob (= 6.1.3)
Expand All @@ -67,51 +67,51 @@ GEM
zeitwerk (~> 2.3)
addressable (2.7.0)
public_suffix (>= 2.0.2, < 5.0)
after_commit_everywhere (0.1.5)
after_commit_everywhere (1.0.0)
activerecord (>= 4.2)
appsignal (2.11.1)
appsignal (3.0.0)
rack
ast (2.4.1)
aws-eventstream (1.1.0)
aws-partitions (1.414.0)
aws-sdk-codedeploy (1.37.0)
aws-sdk-core (~> 3, >= 3.109.0)
ast (2.4.2)
aws-eventstream (1.1.1)
aws-partitions (1.431.1)
aws-sdk-codedeploy (1.38.0)
aws-sdk-core (~> 3, >= 3.112.0)
aws-sigv4 (~> 1.1)
aws-sdk-core (3.110.0)
aws-sdk-core (3.112.1)
aws-eventstream (~> 1, >= 1.0.2)
aws-partitions (~> 1, >= 1.239.0)
aws-sigv4 (~> 1.1)
jmespath (~> 1.0)
aws-sdk-kms (1.40.0)
aws-sdk-core (~> 3, >= 3.109.0)
aws-sdk-kms (1.42.0)
aws-sdk-core (~> 3, >= 3.112.0)
aws-sigv4 (~> 1.1)
aws-sdk-s3 (1.87.0)
aws-sdk-core (~> 3, >= 3.109.0)
aws-sdk-s3 (1.90.0)
aws-sdk-core (~> 3, >= 3.112.0)
aws-sdk-kms (~> 1)
aws-sigv4 (~> 1.1)
aws-sigv4 (1.2.2)
aws-sigv4 (1.2.3)
aws-eventstream (~> 1, >= 1.0.2)
bcrypt (3.1.16)
bindex (0.8.1)
bootsnap (1.5.1)
bootsnap (1.7.2)
msgpack (~> 1.0)
brakeman (5.0.0)
builder (3.2.4)
bundler-audit (0.7.0.1)
bundler (>= 1.2.0, < 3)
thor (>= 0.18, < 2)
byebug (11.1.3)
capybara (3.34.0)
capybara (3.35.3)
addressable
mini_mime (>= 0.1.3)
nokogiri (~> 1.8)
rack (>= 1.6.0)
rack-test (>= 0.6.3)
regexp_parser (~> 1.5)
regexp_parser (>= 1.5, < 3.0)
xpath (~> 3.2)
childprocess (3.0.0)
coderay (1.1.3)
commonmarker (0.21.0)
commonmarker (0.21.2)
ruby-enum (~> 0.5)
concurrent-ruby (1.1.8)
crack (0.4.5)
Expand All @@ -124,7 +124,7 @@ GEM
responders
warden (~> 1.2.3)
diff-lcs (1.4.4)
docile (1.3.4)
docile (1.3.5)
dotenv (2.7.6)
dotenv-rails (2.7.6)
dotenv (= 2.7.6)
Expand All @@ -135,15 +135,17 @@ GEM
factory_bot_rails (6.1.0)
factory_bot (~> 6.1.0)
railties (>= 5.0.0)
faker (2.15.1)
faker (2.16.0)
i18n (>= 1.6, < 2)
faraday (1.2.0)
faraday (1.3.0)
faraday-net_http (~> 1.0)
multipart-post (>= 1.2, < 3)
ruby2_keywords
ffi (1.14.2)
faraday-net_http (1.0.1)
ffi (1.15.0)
globalid (0.4.2)
activesupport (>= 4.2.0)
govuk_design_system_formbuilder (2.1.5)
govuk_design_system_formbuilder (2.1.9)
actionview (>= 5.2)
activemodel (>= 5.2)
activesupport (>= 5.2)
Expand All @@ -153,7 +155,7 @@ GEM
image_processing (1.12.1)
mini_magick (>= 4.9.5, < 5)
ruby-vips (>= 2.0.17, < 3)
jbuilder (2.10.1)
jbuilder (2.11.2)
activesupport (>= 5.0.0)
jmespath (1.4.0)
jwt (2.2.2)
Expand All @@ -166,8 +168,8 @@ GEM
nokogiri (>= 1.5.9)
mail (2.7.1)
mini_mime (>= 0.1.1)
mail-notify (1.0.3)
actionmailer (>= 5.2.4.2, < 6.2)
mail-notify (1.0.4)
actionmailer (>= 5.2.4.3)
actionpack (>= 5.2.4.3)
actionview (>= 5.2.4.3)
activesupport (>= 5.2.4.3)
Expand All @@ -181,30 +183,30 @@ GEM
mini_mime (1.0.2)
mini_portile2 (2.5.0)
minitest (5.14.4)
msgpack (1.3.3)
msgpack (1.4.2)
multipart-post (2.1.1)
nio4r (2.5.7)
nokogiri (1.11.1)
mini_portile2 (~> 2.5.0)
racc (~> 1.4)
notifications-ruby-client (5.3.0)
jwt (>= 1.5, < 3)
openapi3_parser (0.8.2)
openapi3_parser (0.9.0)
commonmarker (~> 0.17)
psych (~> 3.1)
orm_adapter (0.5.0)
parallel (1.20.1)
parser (3.0.0.0)
ast (~> 2.4.1)
pdfkit (0.8.4.3.2)
pdfkit (0.8.5)
pg (1.2.3)
pry (0.13.1)
coderay (~> 1.1)
method_source (~> 1.0)
pry-byebug (3.9.0)
byebug (~> 11.0)
pry (~> 0.13.0)
psych (3.3.0)
psych (3.3.1)
public_suffix (4.0.6)
puma (4.3.7)
nio4r (~> 2.0)
Expand Down Expand Up @@ -249,21 +251,21 @@ GEM
rb-fsevent (0.10.4)
rb-inotify (0.10.1)
ffi (~> 1.0)
regexp_parser (1.8.2)
regexp_parser (2.1.1)
responders (3.0.1)
actionpack (>= 5.0)
railties (>= 5.0)
rexml (3.2.4)
rgeo (2.2.0)
rgeo-activerecord (6.2.2)
rgeo-activerecord (7.0.1)
activerecord (>= 5.0)
rgeo (>= 1.0.0)
rspec-core (3.10.1)
rspec-support (~> 3.10.0)
rspec-expectations (3.10.1)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.10.0)
rspec-mocks (3.10.1)
rspec-mocks (3.10.2)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.10.0)
rspec-rails (4.0.2)
Expand All @@ -274,8 +276,8 @@ GEM
rspec-expectations (~> 3.10)
rspec-mocks (~> 3.10)
rspec-support (~> 3.10)
rspec-support (3.10.1)
rswag-ui (2.3.1)
rspec-support (3.10.2)
rswag-ui (2.4.0)
actionpack (>= 3.1, < 7.0)
railties (>= 3.1, < 7.0)
rubocop (0.87.1)
Expand Down Expand Up @@ -303,18 +305,18 @@ GEM
rubocop
rubocop-rspec (1.42.0)
rubocop (>= 0.87.0)
ruby-enum (0.8.0)
ruby-enum (0.9.0)
i18n
ruby-progressbar (1.11.0)
ruby-vips (2.0.17)
ffi (~> 1.9)
ruby2_keywords (0.0.2)
ruby-vips (2.1.0)
ffi (~> 1.12)
ruby2_keywords (0.0.4)
ruby_dep (1.5.0)
rubyzip (2.3.0)
selenium-webdriver (3.142.7)
childprocess (>= 0.5, < 4.0)
rubyzip (>= 1.2.2)
simplecov (0.20.0)
simplecov (0.21.2)
docile (~> 1.1)
simplecov-html (~> 0.11)
simplecov_json_formatter (~> 0.1)
Expand All @@ -338,7 +340,7 @@ GEM
activemodel (>= 6.0.0)
bindex (>= 0.4.0)
railties (>= 6.0.0)
webmock (3.11.0)
webmock (3.12.1)
addressable (>= 2.3.6)
crack (>= 0.3.2)
hashdiff (>= 0.4.0, < 2.0.0)
Expand Down
2 changes: 1 addition & 1 deletion app/views/api/v1/planning_applications/index.json.jbuilder
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

json.data @planning_applications.each do |planning_application|
json.partial! "show.json.jbuilder", planning_application: planning_application
json.partial! "show", planning_application: planning_application
end
2 changes: 1 addition & 1 deletion app/views/api/v1/planning_applications/show.json.jbuilder
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# frozen_string_literal: true

json.partial! "show.json.jbuilder", planning_application: @planning_application
json.partial! "show", planning_application: @planning_application
2 changes: 1 addition & 1 deletion app/views/documents/_archive_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<% if form.object.errors.any? %>
<% form.object.errors.each do |error| %>
<span id="status-error" class="govuk-error-message">
<span class="govuk-visually-hidden">Error:</span><%= error %></span>
<span class="govuk-visually-hidden">Error:</span><%= error.message %></span>
<% end %>
<% end %>
<p>
Expand Down
6 changes: 3 additions & 3 deletions app/views/documents/_edit_and_upload.html.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<%= form_with model: [@planning_application, @document], local: true, class: "document", builder: GOVUKDesignSystemFormBuilder::FormBuilder do |form| %>
<%= render partial: 'documents/form_partials/upload.html.erb', locals: {form: form} %>
<%= render partial: 'documents/form_partials/upload', locals: {form: form} %>

<div class="govuk-form-group <%= @document.errors.any? ? 'govuk-form-group--error' : '' %>">
<% if @document.errors[:numbers].any? %>
Expand All @@ -8,8 +8,8 @@
<span class="govuk-visually-hidden">Error:</span><%= error %></span>
<% end %>
<% end %>
<%= render partial: 'documents/form_partials/tags.html.erb', locals: {form: form} %>
<%= render partial: 'documents/form_partials/privacy.html.erb', locals: {form: form} %>
<%= render partial: 'documents/form_partials/tags', locals: {form: form} %>
<%= render partial: 'documents/form_partials/privacy', locals: {form: form} %>

<div class="govuk-form-group">
<%= form.submit "Save", class: "govuk-button", data: { module: "govuk-button" } %>
Expand Down
4 changes: 2 additions & 2 deletions app/views/planning_applications/cancel_confirmation.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@
</p>
<div class="govuk-form-group <%= form.object.errors.any? ? 'govuk-form-group--error' : '' %>">
<% if form.object.errors.any? %>
<% form.object.errors.each do |attribute, error| %>
<% form.object.errors.each do |error| %>
<span id="status-error" class="govuk-error-message">
<span class="govuk-visually-hidden">Error:</span><%= error %></span>
<span class="govuk-visually-hidden">Error:</span><%= error.message %></span>
<% end %>
<% end %>
<div class="govuk-radios govuk-radios--conditional" data-module="govuk-radios" style="margin-bottom: 20px;">
Expand Down
4 changes: 2 additions & 2 deletions app/views/planning_applications/recommendation_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
You need to check that the applicant's answers and proposal documents meet the permitted development requirements.
</p>
<% if form.object.errors.any? %>
<% form.object.errors.each do |attribute, error| %>
<% form.object.errors.each do |error| %>
<span id="status-error" class="govuk-error-message">
<span class="govuk-visually-hidden">Error:</span>
<%= error %>
<%= error.type %>
</span>
<% end %>
<% end %>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
<%= form_with model: @planning_application, url: validate_documents_planning_application_path(@planning_application), local: true, builder: GOVUKDesignSystemFormBuilder::FormBuilder do |form| %>
<fieldset class="govuk-fieldset">
<% if form.object.errors.any? %>
<% form.object.errors.each do |attribute, error| %>
<% form.object.errors.each do |error| %>
<span id="status-error" class="govuk-error-message">
<span class="govuk-visually-hidden">Error:</span><%= error %></span>
<span class="govuk-visually-hidden">Error:</span><%= error.message %></span>
<% end %>
<% end %>
<%= form.govuk_radio_buttons_fieldset(:status, legend: { size: 's', text: 'Are the documents valid?' }) do %>
Expand Down
1 change: 1 addition & 0 deletions config.ru
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# frozen_string_literal: true

# This file is used by Rack-based servers to start the application.

require_relative "config/environment"
Expand Down
2 changes: 1 addition & 1 deletion config/environments/development.rb
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
config.active_record.verbose_query_logs = true

# Raises error for missing translations.
config.action_view.raise_on_missing_translations = true
config.i18n.raise_on_missing_translations = true

# Use an evented file watcher to asynchronously detect changes in source code,
# routes, locales, etc. This feature depends on the listen gem.
Expand Down
2 changes: 1 addition & 1 deletion config/environments/test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,5 +50,5 @@
config.active_support.deprecation = :stderr

# Raises error for missing translations.
config.action_view.raise_on_missing_translations = true
config.i18n.raise_on_missing_translations = true
end
5 changes: 3 additions & 2 deletions config/initializers/filter_parameter_logging.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# frozen_string_literal: true

# Be sure to restart your server when you modify this file.

# Configure sensitive parameters which will be filtered from the log file.
Rails.application.config.filter_parameters += [
:passw, :secret, :token, :_key, :crypt, :salt, :certificate, :otp, :ssn
Rails.application.config.filter_parameters += %i[
passw secret token _key crypt salt certificate otp ssn
]
1 change: 1 addition & 0 deletions config/initializers/inflections.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# frozen_string_literal: true

# Be sure to restart your server when you modify this file.

# Add new inflection rules using the following format. Inflections
Expand Down
Loading

0 comments on commit b0c83c2

Please sign in to comment.