diff --git a/Gemfile b/Gemfile index 601b330a..90f94e46 100644 --- a/Gemfile +++ b/Gemfile @@ -32,8 +32,10 @@ group :development, :test do gem "github_changelog_generator" # Used to ensure the code base matches our agreed styles and conventions gem "rubocop" + gem "rubocop-capybara" gem "rubocop-rails" gem "rubocop-rspec" + gem "rubocop-rspec_rails" gem "sass-rails", "~> 5" end diff --git a/Gemfile.lock b/Gemfile.lock index 69856b88..397e3b4c 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -3,7 +3,7 @@ PATH specs: flood_risk_engine (1.2) aasm (~> 5.5) - activerecord-postgis-adapter + activerecord-postgis-adapter (~> 9) activerecord-session_store (~> 2) defra_ruby_address defra_ruby_alert (~> 2.1) @@ -24,7 +24,7 @@ PATH phonelib (~> 0.6) rails (~> 7.1) rgeo - rgeo-activerecord + rgeo-activerecord (~> 7) sucker_punch (~> 3) validates_email_format_of (~> 1) @@ -33,35 +33,35 @@ GEM specs: aasm (5.5.0) concurrent-ruby (~> 1.0) - actioncable (7.1.4.1) - actionpack (= 7.1.4.1) - activesupport (= 7.1.4.1) + actioncable (7.1.5) + actionpack (= 7.1.5) + activesupport (= 7.1.5) nio4r (~> 2.0) websocket-driver (>= 0.6.1) zeitwerk (~> 2.6) - actionmailbox (7.1.4.1) - actionpack (= 7.1.4.1) - activejob (= 7.1.4.1) - activerecord (= 7.1.4.1) - activestorage (= 7.1.4.1) - activesupport (= 7.1.4.1) + actionmailbox (7.1.5) + actionpack (= 7.1.5) + activejob (= 7.1.5) + activerecord (= 7.1.5) + activestorage (= 7.1.5) + activesupport (= 7.1.5) mail (>= 2.7.1) net-imap net-pop net-smtp - actionmailer (7.1.4.1) - actionpack (= 7.1.4.1) - actionview (= 7.1.4.1) - activejob (= 7.1.4.1) - activesupport (= 7.1.4.1) + actionmailer (7.1.5) + actionpack (= 7.1.5) + actionview (= 7.1.5) + activejob (= 7.1.5) + activesupport (= 7.1.5) mail (~> 2.5, >= 2.5.4) net-imap net-pop net-smtp rails-dom-testing (~> 2.2) - actionpack (7.1.4.1) - actionview (= 7.1.4.1) - activesupport (= 7.1.4.1) + actionpack (7.1.5) + actionview (= 7.1.5) + activesupport (= 7.1.5) nokogiri (>= 1.8.5) racc rack (>= 2.2.4) @@ -69,27 +69,27 @@ GEM rack-test (>= 0.6.3) rails-dom-testing (~> 2.2) rails-html-sanitizer (~> 1.6) - actiontext (7.1.4.1) - actionpack (= 7.1.4.1) - activerecord (= 7.1.4.1) - activestorage (= 7.1.4.1) - activesupport (= 7.1.4.1) + actiontext (7.1.5) + actionpack (= 7.1.5) + activerecord (= 7.1.5) + activestorage (= 7.1.5) + activesupport (= 7.1.5) globalid (>= 0.6.0) nokogiri (>= 1.8.5) - actionview (7.1.4.1) - activesupport (= 7.1.4.1) + actionview (7.1.5) + activesupport (= 7.1.5) builder (~> 3.1) erubi (~> 1.11) rails-dom-testing (~> 2.2) rails-html-sanitizer (~> 1.6) - activejob (7.1.4.1) - activesupport (= 7.1.4.1) + activejob (7.1.5) + activesupport (= 7.1.5) globalid (>= 0.3.6) - activemodel (7.1.4.1) - activesupport (= 7.1.4.1) - activerecord (7.1.4.1) - activemodel (= 7.1.4.1) - activesupport (= 7.1.4.1) + activemodel (7.1.5) + activesupport (= 7.1.5) + activerecord (7.1.5) + activemodel (= 7.1.5) + activesupport (= 7.1.5) timeout (>= 0.4.0) activerecord-postgis-adapter (9.0.2) activerecord (~> 7.1.0) @@ -101,52 +101,57 @@ GEM multi_json (~> 1.11, >= 1.11.2) rack (>= 2.0.8, < 4) railties (>= 6.1) - activestorage (7.1.4.1) - actionpack (= 7.1.4.1) - activejob (= 7.1.4.1) - activerecord (= 7.1.4.1) - activesupport (= 7.1.4.1) + activestorage (7.1.5) + actionpack (= 7.1.5) + activejob (= 7.1.5) + activerecord (= 7.1.5) + activesupport (= 7.1.5) marcel (~> 1.0) - activesupport (7.1.4.1) + activesupport (7.1.5) base64 + benchmark (>= 0.3) bigdecimal concurrent-ruby (~> 1.0, >= 1.0.2) connection_pool (>= 2.2.5) drb i18n (>= 1.6, < 2) + logger (>= 1.4.2) minitest (>= 5.1) mutex_m + securerandom (>= 0.3) tzinfo (~> 2.0) addressable (2.8.7) public_suffix (>= 2.0.2, < 7.0) - airbrake (13.0.3) + airbrake (13.0.4) airbrake-ruby (~> 6.0) - airbrake-ruby (6.2.1) + airbrake-ruby (6.2.2) rbtree3 (~> 0.6) ast (2.4.2) - async (2.5.1) - console (~> 1.10) - io-event (~> 1.1) - timers (~> 4.1) - async-http (0.60.1) - async (>= 1.25) - async-io (>= 1.28) - async-pool (>= 0.2) - protocol-http (~> 0.24.0) - protocol-http1 (~> 0.15.0) - protocol-http2 (~> 0.15.0) - traces (>= 0.8.0) - async-http-faraday (0.12.0) + async (2.21.1) + console (~> 1.29) + fiber-annotation + io-event (~> 1.6, >= 1.6.5) + async-http (0.86.0) + async (>= 2.10.2) + async-pool (~> 0.9) + io-endpoint (~> 0.14) + io-stream (~> 0.6) + metrics (~> 0.12) + protocol-http (~> 0.43) + protocol-http1 (>= 0.28.1) + protocol-http2 (~> 0.22) + traces (~> 0.10) + async-http-faraday (0.19.0) async-http (~> 0.42) faraday - async-io (1.35.0) - async - async-pool (0.4.0) + async-pool (0.10.2) async (>= 1.25) - autoprefixer-rails (10.4.13.0) + traces + autoprefixer-rails (10.4.19.0) execjs (~> 2) awesome_print (1.9.2) base64 (0.2.0) + benchmark (0.4.0) bigdecimal (3.1.8) bootstrap-sass (3.4.1) autoprefixer-rails (>= 5.2.1) @@ -165,18 +170,19 @@ GEM rack-test (>= 0.6.3) regexp_parser (>= 1.5, < 3.0) xpath (~> 3.2) - cgi (0.3.6) + cgi (0.4.1) cliver (0.3.2) concurrent-ruby (1.3.4) connection_pool (2.4.1) - console (1.17.0) + console (1.29.2) fiber-annotation - fiber-local + fiber-local (~> 1.1) + json crack (1.0.0) bigdecimal rexml crass (1.0.6) - date (3.4.0) + date (3.4.1) defra_ruby_address (0.1.0) rest-client (~> 2.0) defra_ruby_alert (2.2.1) @@ -204,7 +210,7 @@ GEM validates_email_format_of dibber (0.7.0) diff-lcs (1.5.1) - docile (1.4.0) + docile (1.4.1) domain_name (0.6.20240107) dotenv (2.8.1) dotenv-rails (2.8.1) @@ -212,7 +218,7 @@ GEM railties (>= 3.2) drb (2.2.1) erubi (1.13.0) - execjs (2.8.1) + execjs (2.10.0) factory_bot (6.5.0) activesupport (>= 5.0.0) factory_bot_rails (6.4.4) @@ -220,17 +226,30 @@ GEM railties (>= 5.0.0) faker (2.23.0) i18n (>= 1.8.11, < 2) - faraday (2.9.0) - faraday-net_http (>= 2.0, < 3.2) - faraday-http-cache (2.5.0) + faraday (2.12.2) + faraday-net_http (>= 2.0, < 3.5) + json + logger + faraday-http-cache (2.5.1) faraday (>= 0.8) - faraday-net_http (3.1.0) - net-http + faraday-net_http (3.4.0) + net-http (>= 0.5.0) faraday-retry (2.2.1) faraday (~> 2.0) - ffi (1.15.5) + ffi (1.17.0-aarch64-linux-gnu) + ffi (1.17.0-aarch64-linux-musl) + ffi (1.17.0-arm-linux-gnu) + ffi (1.17.0-arm-linux-musl) + ffi (1.17.0-arm64-darwin) + ffi (1.17.0-x86-linux-gnu) + ffi (1.17.0-x86-linux-musl) + ffi (1.17.0-x86_64-darwin) + ffi (1.17.0-x86_64-linux-gnu) + ffi (1.17.0-x86_64-linux-musl) fiber-annotation (0.2.0) - fiber-local (1.0.0) + fiber-local (1.1.0) + fiber-storage + fiber-storage (1.0.0) github_changelog_generator (1.16.4) activesupport async (>= 1.25.0) @@ -247,17 +266,19 @@ GEM activemodel (>= 6.1) activesupport (>= 6.1) html-attributes-utils (~> 1) - hashdiff (1.1.1) + hashdiff (1.1.2) high_voltage (3.1.2) html-attributes-utils (1.0.2) activesupport (>= 6.1.4.4) http-accept (1.7.0) - http-cookie (1.0.7) + http-cookie (1.0.8) domain_name (~> 0.5) i18n (1.14.6) concurrent-ruby (~> 1.0) - io-console (0.7.2) - io-event (1.2.2) + io-console (0.8.0) + io-endpoint (0.14.0) + io-event (1.7.4) + io-stream (0.6.1) irb (1.14.1) rdoc (>= 4.0.0) reline (>= 0.4.2) @@ -265,11 +286,11 @@ GEM rails-dom-testing (>= 1, < 3) railties (>= 4.2.0) thor (>= 0.14, < 2.0) - json (2.7.5) - jwt (2.8.2) + json (2.9.0) + jwt (2.9.3) base64 language_server-protocol (3.17.0.3) - logger (1.6.1) + logger (1.6.2) loofah (2.23.1) crass (~> 1.0.2) nokogiri (>= 1.12.0) @@ -280,16 +301,16 @@ GEM net-smtp marcel (1.0.4) matrix (0.4.2) + metrics (0.12.1) mime-types (3.6.0) logger mime-types-data (~> 3.2015) - mime-types-data (3.2024.1105) + mime-types-data (3.2024.1203) mini_mime (1.1.5) - mini_portile2 (2.8.8) - minitest (5.25.1) + minitest (5.25.4) multi_json (1.15.0) - mutex_m (0.2.0) - net-http (0.4.1) + mutex_m (0.3.0) + net-http (0.6.0) uri net-imap (0.5.1) date @@ -301,9 +322,18 @@ GEM net-smtp (0.5.0) net-protocol netrc (0.11.0) - nio4r (2.7.3) - nokogiri (1.16.7) - mini_portile2 (~> 2.8.2) + nio4r (2.7.4) + nokogiri (1.17.0-aarch64-linux) + racc (~> 1.4) + nokogiri (1.17.0-arm-linux) + racc (~> 1.4) + nokogiri (1.17.0-arm64-darwin) + racc (~> 1.4) + nokogiri (1.17.0-x86-linux) + racc (~> 1.4) + nokogiri (1.17.0-x86_64-darwin) + racc (~> 1.4) + nokogiri (1.17.0-x86_64-linux) racc (~> 1.4) notifications-ruby-client (6.2.0) jwt (>= 1.5, < 3) @@ -312,23 +342,24 @@ GEM sawyer (~> 0.9) os_map_ref (0.5.0) parallel (1.26.3) - parser (3.3.5.1) + parser (3.3.6.0) ast (~> 2.4.1) racc pg (1.5.9) - phonelib (0.9.3) + phonelib (0.10.1) poltergeist (1.18.1) capybara (>= 2.1, < 4) cliver (~> 0.3.1) websocket-driver (>= 0.2.0) - protocol-hpack (1.4.2) - protocol-http (0.24.7) - protocol-http1 (0.15.1) + protocol-hpack (1.5.1) + protocol-http (0.47.1) + protocol-http1 (0.28.1) protocol-http (~> 0.22) - protocol-http2 (0.15.1) + protocol-http2 (0.22.0) protocol-hpack (~> 1.4) protocol-http (~> 0.18) - psych (5.2.0) + psych (5.2.1) + date stringio public_suffix (6.0.1) racc (1.8.1) @@ -340,20 +371,20 @@ GEM rackup (1.0.1) rack (< 3) webrick - rails (7.1.4.1) - actioncable (= 7.1.4.1) - actionmailbox (= 7.1.4.1) - actionmailer (= 7.1.4.1) - actionpack (= 7.1.4.1) - actiontext (= 7.1.4.1) - actionview (= 7.1.4.1) - activejob (= 7.1.4.1) - activemodel (= 7.1.4.1) - activerecord (= 7.1.4.1) - activestorage (= 7.1.4.1) - activesupport (= 7.1.4.1) + rails (7.1.5) + actioncable (= 7.1.5) + actionmailbox (= 7.1.5) + actionmailer (= 7.1.5) + actionpack (= 7.1.5) + actiontext (= 7.1.5) + actionview (= 7.1.5) + activejob (= 7.1.5) + activemodel (= 7.1.5) + activerecord (= 7.1.5) + activestorage (= 7.1.5) + activesupport (= 7.1.5) bundler (>= 1.15.0) - railties (= 7.1.4.1) + railties (= 7.1.5) rails-controller-testing (1.0.5) actionpack (>= 5.0.1.rc1) actionview (>= 5.0.1.rc1) @@ -362,12 +393,12 @@ GEM activesupport (>= 5.0.0) minitest nokogiri (>= 1.6) - rails-html-sanitizer (1.6.0) + rails-html-sanitizer (1.6.1) loofah (~> 2.21) - nokogiri (~> 1.14) - railties (7.1.4.1) - actionpack (= 7.1.4.1) - activesupport (= 7.1.4.1) + nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0) + railties (7.1.5) + actionpack (= 7.1.5) + activesupport (= 7.1.5) irb rackup (>= 1.0.0) rake (>= 12.2) @@ -376,13 +407,13 @@ GEM rainbow (3.1.1) rake (13.2.1) rb-fsevent (0.11.2) - rb-inotify (0.10.1) + rb-inotify (0.11.1) ffi (~> 1.0) rbtree3 (0.7.1) rdoc (6.8.1) psych (>= 4.0.0) - regexp_parser (2.9.2) - reline (0.5.11) + regexp_parser (2.9.3) + reline (0.5.12) io-console (~> 0.5) rest-client (2.1.0) http-accept (>= 1.7.0, < 2.0) @@ -401,15 +432,15 @@ GEM rspec-core (~> 3.13.0) rspec-expectations (~> 3.13.0) rspec-mocks (~> 3.13.0) - rspec-core (3.13.0) + rspec-core (3.13.2) rspec-support (~> 3.13.0) - rspec-expectations (3.13.2) + rspec-expectations (3.13.3) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.13.0) rspec-html-matchers (0.10.0) nokogiri (~> 1) rspec (>= 3.0.0.a) - rspec-mocks (3.13.1) + rspec-mocks (3.13.2) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.13.0) rspec-rails (6.1.5) @@ -420,37 +451,35 @@ GEM rspec-expectations (~> 3.13) rspec-mocks (~> 3.13) rspec-support (~> 3.13) - rspec-support (3.13.1) - rubocop (1.68.0) + rspec-support (3.13.2) + rubocop (1.69.1) json (~> 2.3) language_server-protocol (>= 3.17.0) parallel (~> 1.10) parser (>= 3.3.0.2) rainbow (>= 2.2.2, < 4.0) - regexp_parser (>= 2.4, < 3.0) - rubocop-ast (>= 1.32.2, < 2.0) + regexp_parser (>= 2.9.3, < 3.0) + rubocop-ast (>= 1.36.2, < 2.0) ruby-progressbar (~> 1.7) - unicode-display_width (>= 2.4.0, < 3.0) - rubocop-ast (1.33.0) + unicode-display_width (>= 2.4.0, < 4.0) + rubocop-ast (1.36.2) parser (>= 3.3.1.0) - rubocop-capybara (2.20.0) - rubocop (~> 1.41) - rubocop-factory_bot (2.25.1) + rubocop-capybara (2.21.0) rubocop (~> 1.41) - rubocop-rails (2.25.1) + rubocop-factory_bot (2.26.1) + rubocop (~> 1.61) + rubocop-rails (2.27.0) activesupport (>= 4.2.0) rack (>= 1.1) - rubocop (>= 1.33.0, < 2.0) + rubocop (>= 1.52.0, < 2.0) rubocop-ast (>= 1.31.1, < 2.0) rubocop-rake (0.6.0) rubocop (~> 1.0) - rubocop-rspec (2.29.1) - rubocop (~> 1.40) - rubocop-capybara (~> 2.17) - rubocop-factory_bot (~> 2.22) - rubocop-rspec_rails (~> 2.28) - rubocop-rspec_rails (2.28.3) - rubocop (~> 1.40) + rubocop-rspec (3.2.0) + rubocop (~> 1.61) + rubocop-rspec_rails (2.30.0) + rubocop (~> 1.61) + rubocop-rspec (~> 3, >= 3.0.1) ruby-progressbar (1.13.0) sass (3.7.4) sass-listen (~> 4.0.0) @@ -468,6 +497,7 @@ GEM sawyer (0.9.2) addressable (>= 2.3.5) faraday (>= 0.17.3, < 3) + securerandom (0.4.0) shoulda-matchers (6.4.0) activesupport (>= 5.2.0) simplecov (0.17.1) @@ -476,27 +506,29 @@ GEM simplecov-html (~> 0.10.0) simplecov-html (0.10.2) simpleidn (0.2.3) - sprockets (3.7.2) + sprockets (3.7.5) + base64 concurrent-ruby (~> 1.0) rack (> 1, < 3) - sprockets-rails (3.4.2) - actionpack (>= 5.2) - activesupport (>= 5.2) + sprockets-rails (3.5.2) + actionpack (>= 6.1) + activesupport (>= 6.1) sprockets (>= 3.0.0) stringio (3.1.2) sucker_punch (3.2.0) concurrent-ruby (~> 1.0) thor (1.3.2) - tilt (2.2.0) + tilt (2.4.0) timeout (0.4.2) - timers (4.3.5) - traces (0.9.1) + traces (0.14.1) tzinfo (2.0.6) concurrent-ruby (~> 1.0) uk_postcode (2.1.8) - unicode-display_width (2.6.0) + unicode-display_width (3.1.2) + unicode-emoji (~> 4.0, >= 4.0.4) + unicode-emoji (4.0.4) uniform_notifier (1.16.0) - uri (0.13.0) + uri (1.0.2) validates_email_format_of (1.8.2) i18n (>= 0.8.0) simpleidn @@ -506,7 +538,7 @@ GEM addressable (>= 2.8.0) crack (>= 0.3.2) hashdiff (>= 0.4.0, < 2.0.0) - webrick (1.9.0) + webrick (1.9.1) websocket-driver (0.7.6) websocket-extensions (>= 0.1.0) websocket-extensions (0.1.5) @@ -515,7 +547,19 @@ GEM zeitwerk (2.7.1) PLATFORMS - ruby + aarch64-linux + aarch64-linux-gnu + aarch64-linux-musl + arm-linux + arm-linux-gnu + arm-linux-musl + arm64-darwin + x86-linux + x86-linux-gnu + x86-linux-musl + x86_64-darwin + x86_64-linux-gnu + x86_64-linux-musl DEPENDENCIES awesome_print @@ -537,8 +581,10 @@ DEPENDENCIES rspec-html-matchers rspec-rails (~> 6) rubocop + rubocop-capybara rubocop-rails rubocop-rspec + rubocop-rspec_rails sass-rails (~> 5) shoulda-matchers (~> 6) simplecov (~> 0.17.1) @@ -546,4 +592,4 @@ DEPENDENCIES webmock (~> 3) BUNDLED WITH - 2.3.13 + 2.5.8 diff --git a/app/models/flood_risk_engine/address.rb b/app/models/flood_risk_engine/address.rb index 9acdab23..4d919196 100644 --- a/app/models/flood_risk_engine/address.rb +++ b/app/models/flood_risk_engine/address.rb @@ -12,7 +12,7 @@ class Address < ApplicationRecord # Covers the RCDP Types # - enum address_type: { + enum :address_type, { primary: 0, secondary: 1, site: 2, diff --git a/app/models/flood_risk_engine/contact.rb b/app/models/flood_risk_engine/contact.rb index e884bce5..bf6f8dbb 100644 --- a/app/models/flood_risk_engine/contact.rb +++ b/app/models/flood_risk_engine/contact.rb @@ -7,7 +7,7 @@ class Contact < ApplicationRecord has_one :organisation, dependent: :restrict_with_exception has_one :address, as: :addressable, dependent: :restrict_with_exception - enum contact_type: { + enum :contact_type, { individual: 0, partner: 1, employee: 2, @@ -18,9 +18,9 @@ class Contact < ApplicationRecord } # Derived from RCDP customer data model - enum title: { "na" => 0, "Mr" => 1, "Mrs" => 2, "Miss" => 3, "Ms" => 4, "Dr" => 5, "Rev" => 6, "Sir" => 7, - "Lady" => 8, "Lord" => 9, "Captain" => 10, "Major" => 11, "Professor" => 12, "Dame" => 13, - "Colonel" => 14 } + enum :title, { "na" => 0, "Mr" => 1, "Mrs" => 2, "Miss" => 3, "Ms" => 4, "Dr" => 5, "Rev" => 6, "Sir" => 7, + "Lady" => 8, "Lord" => 9, "Captain" => 10, "Major" => 11, "Professor" => 12, "Dame" => 13, + "Colonel" => 14 } after_save do organisation.try(:update_searchable_content) diff --git a/app/models/flood_risk_engine/enrollment_exemption.rb b/app/models/flood_risk_engine/enrollment_exemption.rb index 18539241..2aa18d1c 100644 --- a/app/models/flood_risk_engine/enrollment_exemption.rb +++ b/app/models/flood_risk_engine/enrollment_exemption.rb @@ -8,7 +8,7 @@ class EnrollmentExemption < ApplicationRecord belongs_to :exemption has_many :comments, as: :commentable - enum status: { + enum :status, { building: 0, # FO: anywhere before the confirmation step pending: 1, # FO: enrollment submitted and awaiting BO processing being_processed: 2, # BO: prevents another admin user from processing it @@ -19,12 +19,12 @@ class EnrollmentExemption < ApplicationRecord deregistered: 7 # BO: approved only } - enum deregister_reason: { + enum :deregister_reason, { registered_in_error: 0, operator_failings: 1 } - enum assistance_mode: { + enum :assistance_mode, { unassisted: 0, fully_assisted: 1, partial: 2, diff --git a/app/models/flood_risk_engine/organisation.rb b/app/models/flood_risk_engine/organisation.rb index 812e31b9..1b2756c1 100644 --- a/app/models/flood_risk_engine/organisation.rb +++ b/app/models/flood_risk_engine/organisation.rb @@ -10,7 +10,7 @@ class Organisation < ApplicationRecord as: :addressable, dependent: :restrict_with_exception - enum org_type: { + enum :org_type, { local_authority: 0, limited_company: 1, limited_liability_partnership: 2, diff --git a/app/models/flood_risk_engine/transient_address.rb b/app/models/flood_risk_engine/transient_address.rb index 263a67d4..44f1bc9f 100644 --- a/app/models/flood_risk_engine/transient_address.rb +++ b/app/models/flood_risk_engine/transient_address.rb @@ -6,7 +6,7 @@ class TransientAddress < ApplicationRecord belongs_to :addressable, polymorphic: true - enum address_type: { unknown: 0, operator: 1, contact: 2, site: 3 } + enum :address_type, { unknown: 0, operator: 1, contact: 2, site: 3 } def manual? uprn.blank? diff --git a/app/services/flood_risk_engine/send_enrollment_submitted_email.rb b/app/services/flood_risk_engine/send_enrollment_submitted_email.rb index 83475d25..f04af086 100644 --- a/app/services/flood_risk_engine/send_enrollment_submitted_email.rb +++ b/app/services/flood_risk_engine/send_enrollment_submitted_email.rb @@ -29,7 +29,7 @@ def validate_enrollment def distinct_recipients [primary_contact_email, secondary_contact_email] - .select(&:present?) + .compact_blank .map(&:strip) .map(&:downcase) .uniq diff --git a/flood_risk_engine.gemspec b/flood_risk_engine.gemspec index ad75ec70..600b9108 100644 --- a/flood_risk_engine.gemspec +++ b/flood_risk_engine.gemspec @@ -52,9 +52,9 @@ Gem::Specification.new do |s| s.add_dependency "validates_email_format_of", "~> 1" # for handling Water Managment Areas spatial data - s.add_dependency "activerecord-postgis-adapter" + s.add_dependency "activerecord-postgis-adapter", "~> 9" s.add_dependency "rgeo" - s.add_dependency "rgeo-activerecord" + s.add_dependency "rgeo-activerecord", "~> 7" s.add_dependency "matrix", "~> 0.4" s.add_dependency "net-imap", "~> 0.2"