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
7 changes: 2 additions & 5 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ source 'https://rubygems.org'
# README) is available at:
# https://github.com/NHSDigital/activemodel-caution.git

gem 'activemodel-caution', '7.1.5.0' # Supports rails ~> 7.1.5.0
gem 'rails', '~> 7.1.5', '>= 7.1.5.1'
gem 'activemodel-caution', '7.2.2.0' # Supports rails ~> 7.2.2.0
gem 'rails', '~> 7.2.2', '>= 7.2.2.2'
# Fixes uninitialized constant ActiveSupport::LoggerThreadSafeLevel::Logger on Rails 7.0x
# and earlier. See https://github.com/rails/rails/issues/54260.
gem 'concurrent-ruby', '1.3.4'
Expand Down Expand Up @@ -64,9 +64,6 @@ gem 'will_paginate'
# net-imap (via ndr_error) requires date. Puma needs us to stick to the ruby default version.
gem 'date', '3.1.3' # Lock to Ruby 3.0 version of gem for live service

# TODO: 2023-09-03: Updating mail to 2.8.1 causes tests failures on Rails 6.1
gem 'mail', '>= 2.1.1', '< 2.8.0' # mail 2.8.0 and 2.8.0.1 have major hidden bugs

gem 'ndr_authenticate', '~> 0.3', '>= 0.3.3'
gem 'ndr_error', '~> 2.0'
gem 'ndr_import'
Expand Down
154 changes: 75 additions & 79 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,89 +2,83 @@ GEM
remote: https://rubygems.org/
specs:
Ascii85 (2.0.1)
actioncable (7.1.5.2)
actionpack (= 7.1.5.2)
activesupport (= 7.1.5.2)
actioncable (7.2.2.2)
actionpack (= 7.2.2.2)
activesupport (= 7.2.2.2)
nio4r (~> 2.0)
websocket-driver (>= 0.6.1)
zeitwerk (~> 2.6)
actionmailbox (7.1.5.2)
actionpack (= 7.1.5.2)
activejob (= 7.1.5.2)
activerecord (= 7.1.5.2)
activestorage (= 7.1.5.2)
activesupport (= 7.1.5.2)
mail (>= 2.7.1)
net-imap
net-pop
net-smtp
actionmailer (7.1.5.2)
actionpack (= 7.1.5.2)
actionview (= 7.1.5.2)
activejob (= 7.1.5.2)
activesupport (= 7.1.5.2)
mail (~> 2.5, >= 2.5.4)
net-imap
net-pop
net-smtp
actionmailbox (7.2.2.2)
actionpack (= 7.2.2.2)
activejob (= 7.2.2.2)
activerecord (= 7.2.2.2)
activestorage (= 7.2.2.2)
activesupport (= 7.2.2.2)
mail (>= 2.8.0)
actionmailer (7.2.2.2)
actionpack (= 7.2.2.2)
actionview (= 7.2.2.2)
activejob (= 7.2.2.2)
activesupport (= 7.2.2.2)
mail (>= 2.8.0)
rails-dom-testing (~> 2.2)
actionpack (7.1.5.2)
actionview (= 7.1.5.2)
activesupport (= 7.1.5.2)
actionpack (7.2.2.2)
actionview (= 7.2.2.2)
activesupport (= 7.2.2.2)
nokogiri (>= 1.8.5)
racc
rack (>= 2.2.4)
rack (>= 2.2.4, < 3.2)
rack-session (>= 1.0.1)
rack-test (>= 0.6.3)
rails-dom-testing (~> 2.2)
rails-html-sanitizer (~> 1.6)
actiontext (7.1.5.2)
actionpack (= 7.1.5.2)
activerecord (= 7.1.5.2)
activestorage (= 7.1.5.2)
activesupport (= 7.1.5.2)
useragent (~> 0.16)
actiontext (7.2.2.2)
actionpack (= 7.2.2.2)
activerecord (= 7.2.2.2)
activestorage (= 7.2.2.2)
activesupport (= 7.2.2.2)
globalid (>= 0.6.0)
nokogiri (>= 1.8.5)
actionview (7.1.5.2)
activesupport (= 7.1.5.2)
actionview (7.2.2.2)
activesupport (= 7.2.2.2)
builder (~> 3.1)
erubi (~> 1.11)
rails-dom-testing (~> 2.2)
rails-html-sanitizer (~> 1.6)
activejob (7.1.5.2)
activesupport (= 7.1.5.2)
activejob (7.2.2.2)
activesupport (= 7.2.2.2)
globalid (>= 0.3.6)
activemodel (7.1.5.2)
activesupport (= 7.1.5.2)
activemodel-caution (7.1.5.0)
actionpack (~> 7.1.5.0)
activemodel (~> 7.1.5.0)
activerecord (~> 7.1.5.0)
activesupport (~> 7.1.5.0)
railties (~> 7.1.5.0)
activerecord (7.1.5.2)
activemodel (= 7.1.5.2)
activesupport (= 7.1.5.2)
activemodel (7.2.2.2)
activesupport (= 7.2.2.2)
activemodel-caution (7.2.2.0)
actionpack (~> 7.2.2.0)
activemodel (~> 7.2.2.0)
activerecord (~> 7.2.2.0)
activesupport (~> 7.2.2.0)
railties (~> 7.2.2.0)
activerecord (7.2.2.2)
activemodel (= 7.2.2.2)
activesupport (= 7.2.2.2)
timeout (>= 0.4.0)
activestorage (7.1.5.2)
actionpack (= 7.1.5.2)
activejob (= 7.1.5.2)
activerecord (= 7.1.5.2)
activesupport (= 7.1.5.2)
activestorage (7.2.2.2)
actionpack (= 7.2.2.2)
activejob (= 7.2.2.2)
activerecord (= 7.2.2.2)
activesupport (= 7.2.2.2)
marcel (~> 1.0)
activesupport (7.1.5.2)
activesupport (7.2.2.2)
base64
benchmark (>= 0.3)
bigdecimal
concurrent-ruby (~> 1.0, >= 1.0.2)
concurrent-ruby (~> 1.0, >= 1.3.1)
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)
tzinfo (~> 2.0, >= 2.0.5)
addressable (2.8.7)
public_suffix (>= 2.0.2, < 7.0)
afm (0.2.2)
Expand Down Expand Up @@ -254,8 +248,11 @@ GEM
crass (~> 1.0.2)
nokogiri (>= 1.12.0)
lumberjack (1.2.10)
mail (2.7.1)
mail (2.8.1)
mini_mime (>= 0.1.1)
net-imap
net-pop
net-smtp
marcel (1.0.4)
matrix (0.4.2)
method_source (1.1.0)
Expand All @@ -269,7 +266,6 @@ GEM
msworddoc-extractor (0.2.0)
ruby-ole
multi_json (1.15.0)
mutex_m (0.3.0)
ndr_authenticate (0.3.4)
devise
devise_saml_authenticatable (~> 1.9)
Expand Down Expand Up @@ -411,7 +407,7 @@ GEM
puma (>= 5.0)
rack
racc (1.8.1)
rack (3.2.0)
rack (3.1.16)
rack-mini-profiler (3.3.1)
rack (>= 1.2.0)
rack-proxy (0.7.7)
Expand All @@ -424,31 +420,31 @@ GEM
rackup (2.2.1)
rack (>= 3)
railroady (1.6.0)
rails (7.1.5.2)
actioncable (= 7.1.5.2)
actionmailbox (= 7.1.5.2)
actionmailer (= 7.1.5.2)
actionpack (= 7.1.5.2)
actiontext (= 7.1.5.2)
actionview (= 7.1.5.2)
activejob (= 7.1.5.2)
activemodel (= 7.1.5.2)
activerecord (= 7.1.5.2)
activestorage (= 7.1.5.2)
activesupport (= 7.1.5.2)
rails (7.2.2.2)
actioncable (= 7.2.2.2)
actionmailbox (= 7.2.2.2)
actionmailer (= 7.2.2.2)
actionpack (= 7.2.2.2)
actiontext (= 7.2.2.2)
actionview (= 7.2.2.2)
activejob (= 7.2.2.2)
activemodel (= 7.2.2.2)
activerecord (= 7.2.2.2)
activestorage (= 7.2.2.2)
activesupport (= 7.2.2.2)
bundler (>= 1.15.0)
railties (= 7.1.5.2)
railties (= 7.2.2.2)
rails-dom-testing (2.2.0)
activesupport (>= 5.0.0)
minitest
nokogiri (>= 1.6)
rails-html-sanitizer (1.6.1)
loofah (~> 2.21)
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.2)
actionpack (= 7.1.5.2)
activesupport (= 7.1.5.2)
irb
railties (7.2.2.2)
actionpack (= 7.2.2.2)
activesupport (= 7.2.2.2)
irb (~> 1.13)
rackup (>= 1.0.0)
rake (>= 12.2)
thor (~> 1.0, >= 1.2.2)
Expand All @@ -472,7 +468,7 @@ GEM
responders (3.1.1)
actionpack (>= 5.2)
railties (>= 5.2)
rexml (3.3.9)
rexml (3.4.4)
roo (2.10.1)
nokogiri (~> 1)
rubyzip (>= 1.3.0, < 3.0.0)
Expand Down Expand Up @@ -564,6 +560,7 @@ GEM
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
unicode-display_width (2.6.0)
useragent (0.16.11)
warden (1.2.9)
rack (>= 2.0.9)
web-console (4.2.1)
Expand Down Expand Up @@ -597,7 +594,7 @@ PLATFORMS
x86_64-linux

DEPENDENCIES
activemodel-caution (= 7.1.5.0)
activemodel-caution (= 7.2.2.0)
bootstrap-table-rails (~> 1.20.2)
byebug
cancancan (~> 3.0)
Expand All @@ -621,7 +618,6 @@ DEPENDENCIES
jquery-rails
jquery-ui-rails (>= 7.0.0)
loofah (>= 2.3.1)
mail (>= 2.1.1, < 2.8.0)
mini_racer (~> 0.14)
minitest
mocha
Expand All @@ -646,7 +642,7 @@ DEPENDENCIES
puma-daemon
rack-mini-profiler
railroady
rails (~> 7.1.5, >= 7.1.5.1)
rails (~> 7.2.2, >= 7.2.2.2)
rainbow
regexp-examples
sass-rails
Expand Down
2 changes: 1 addition & 1 deletion app/models/communication.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class Communication < ApplicationRecord

has_paper_trail

enum medium: { email: 1, phone: 2, letter: 3, in_person: 4 }
enum :medium, { email: 1, phone: 2, letter: 3, in_person: 4 }

validates :medium, presence: true
validates :contacted_at, presence: true
Expand Down
2 changes: 1 addition & 1 deletion app/models/dataset.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class Dataset < ApplicationRecord

delegate :name, to: :dataset_type, prefix: true, allow_nil: true

enum cas_type: { cas_defaults: 1, cas_extras: 2 }
enum :cas_type, { cas_defaults: 1, cas_extras: 2 }

DATASET_BROWSER_TYPES = %w[xml non_xml].freeze

Expand Down
7 changes: 7 additions & 0 deletions bin/brakeman
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env ruby
require "rubygems"
require "bundler/setup"

ARGV.unshift("--ensure-latest")

load Gem.bin_path("brakeman", "brakeman")
8 changes: 8 additions & 0 deletions bin/rubocop
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/usr/bin/env ruby
require "rubygems"
require "bundler/setup"

# explicit rubocop config increases performance slightly while avoiding config confusion.
ARGV.unshift("--config", File.expand_path("../.rubocop.yml", __dir__))

load Gem.bin_path("rubocop", "rubocop")
6 changes: 5 additions & 1 deletion bin/setup
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#!/usr/bin/env ruby
require 'fileutils'

# path to your application root.
APP_ROOT = File.expand_path('..', __dir__)
APP_NAME = 'mbis'.freeze

def system!(*args)
system(*args, exception: true)
Expand Down Expand Up @@ -33,4 +33,8 @@ FileUtils.chdir APP_ROOT do

puts "\n== Restarting application server =="
system! 'bin/rails restart'

# puts "\n== Configuring puma-dev =="
# system 'ln -nfs #{APP_ROOT} ~/.puma-dev/#{APP_NAME}'
# system 'curl -Is https://#{APP_NAME}.test/up | head -n 1'
end
13 changes: 11 additions & 2 deletions config/application.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
TIME_PROCESS_STARTED = Time.now
TIME_PROCESS_STARTED = Time.now # rubocop:disable Rails/TimeZone

require_relative 'boot'

Expand All @@ -11,14 +11,15 @@
require 'ndr_error/middleware/public_exceptions'

module Mbis
# Global application configurations
class Application < Rails::Application
# Initialize configuration defaults for originally generated Rails version.
config.load_defaults 7.1

# Please, add to the `ignore` list any other `lib` subdirectories that do
# not contain `.rb` files, or that should not be reloaded or eager loaded.
# Common ones are `templates`, `generators`, or `middleware`, for example.
config.autoload_lib(ignore: %w(assets tasks))
config.autoload_lib(ignore: %w[assets tasks])

# Configuration for the application, engines, and railties goes here.
#
Expand Down Expand Up @@ -66,6 +67,14 @@ class Application < Rails::Application
config.i18n.fallbacks = true
config.i18n.available_locales = %i[en en-odr]

# Configuration for the application, engines, and railties goes here.
#
# These settings can be overridden in specific environments using the files
# in config/environments, which are processed later.
#
# config.time_zone = "Central Time (US & Canada)"
# config.eager_load_paths << Rails.root.join("extras")

# TODO: Would be nice to push this out to a YAML file and access via `config_for`
# so that we can avoid hardcoding...
config.x.user.internal_domains = ['phe.gov.uk', 'ukhsa.gov.uk']
Expand Down
Loading
Loading