source
stringclasses
1 value
repo
stringlengths
5
63
repo_url
stringlengths
24
82
path
stringlengths
5
167
language
stringclasses
1 value
license
stringclasses
5 values
stars
int64
10
51.4k
ref
stringclasses
23 values
size_bytes
int64
200
258k
text
stringlengths
137
258k
github
ministryofjustice/laa-apply-for-legal-aid
https://github.com/ministryofjustice/laa-apply-for-legal-aid
config/routes.rb
Ruby
mit
19
main
24,996
Rails.application.routes.draw do get "ping", to: "status#ping", format: :json get "healthcheck", to: "status#status", format: :json match "(*any)", to: "pages#servicedown", via: :all if Rails.application.config.x.maintenance_mode root to: "providers/start#index" require "sidekiq/web" require "sidekiq-sta...
github
ministryofjustice/laa-apply-for-legal-aid
https://github.com/ministryofjustice/laa-apply-for-legal-aid
config/puma.rb
Ruby
mit
19
main
2,067
# This configuration file will be evaluated by Puma. The top-level methods that # are invoked here are part of Puma's configuration DSL. For more information # about methods provided by the DSL, see https://puma.io/puma/Puma/DSL.html. # # Puma starts a configurable number of processes (workers) and each process # serve...
github
ministryofjustice/laa-apply-for-legal-aid
https://github.com/ministryofjustice/laa-apply-for-legal-aid
config/application.rb
Ruby
mit
19
main
10,032
require_relative "boot" require "rails/all" # Require the gems listed in Gemfile, including any gems # you've limited to :test, :development, or :production. Bundler.require(*Rails.groups) module LaaApplyForLegalAid class Application < Rails::Application # Initialize configuration defaults for originally gener...
github
ministryofjustice/laa-apply-for-legal-aid
https://github.com/ministryofjustice/laa-apply-for-legal-aid
config/initializers/inflections.rb
Ruby
mit
19
main
997
# Be sure to restart your server when you modify this file. # Add new inflection rules using the following format. Inflections # are locale specific, and you may define rules for as many different # locales as you wish. All of these examples are active by default: # ActiveSupport::Inflector.inflections(:en) do |inflec...
github
ministryofjustice/laa-apply-for-legal-aid
https://github.com/ministryofjustice/laa-apply-for-legal-aid
config/initializers/sidekiq_middleware.rb
Ruby
mit
19
main
309
class SidekiqMiddleware def call(worker, job, _queue) worker.retry_count = job["retry_count"].nil? ? 0 : job["retry_count"] + 1 if worker.respond_to?(:retry_count=) yield end end Sidekiq.configure_server do |config| config.server_middleware do |chain| chain.add SidekiqMiddleware end end
github
ministryofjustice/laa-apply-for-legal-aid
https://github.com/ministryofjustice/laa-apply-for-legal-aid
config/initializers/date_formats.rb
Ruby
mit
19
main
889
# The below hotfix overrides the rails 7 removal of to_s # https://guides.rubyonrails.org/7_0_release_notes.html#active-support-deprecations # and allows our default format to be applied rather than having # to find each date and manually add `.to_fs` to the end of it require "date" class Date alias_method :to_s, :t...
github
ministryofjustice/laa-apply-for-legal-aid
https://github.com/ministryofjustice/laa-apply-for-legal-aid
config/initializers/grover.rb
Ruby
mit
19
main
449
Grover.configure do |config| config.options = { format: "A4", emulate_media: "print", prefer_css_page_size: true, print_background: true, bypass_csp: true, cache: false, wait_until: "networkidle2", display_url: Rails.configuration.x.application.host_url, margin: { top: "10mm"...
github
ministryofjustice/laa-apply-for-legal-aid
https://github.com/ministryofjustice/laa-apply-for-legal-aid
config/initializers/mock_auth.rb
Ruby
mit
19
main
1,637
# frozen_string_literal: true class ValidTestUsersStruct attr_reader :users, :password def initialize(users:, password:) @users = users @password = password end # imitate OpenStruct's behaviour of returning nil for unrecognised methods def method_missing(_meth) nil end def respond_to_missi...
github
ministryofjustice/laa-apply-for-legal-aid
https://github.com/ministryofjustice/laa-apply-for-legal-aid
config/initializers/content_security_policy.rb
Ruby
mit
19
main
1,661
# Be sure to restart your server when you modify this file. # Define an application-wide content security policy. # See the Securing Rails Applications Guide for more information: # https://guides.rubyonrails.org/security.html#content-security-policy-header GOOGLE_ANALYTICS_DOMAIN = "https://*.google-analytics.com".f...
github
ministryofjustice/laa-apply-for-legal-aid
https://github.com/ministryofjustice/laa-apply-for-legal-aid
config/initializers/prometheus_metrics.rb
Ruby
mit
19
main
437
if Rails.env.production? && Rails.configuration.x.kubernetes_deployment require "prometheus_exporter/instrumentation" require "prometheus_exporter/middleware" PrometheusExporter::Client.default = PrometheusExporter::Client.new( host: Rails.configuration.x.metrics_service_host, ) PrometheusExporter::Inst...
github
ministryofjustice/laa-apply-for-legal-aid
https://github.com/ministryofjustice/laa-apply-for-legal-aid
config/initializers/rack_attack.rb
Ruby
mit
19
main
719
class Rack::Attack Rack::Attack.cache.store = if Rails.configuration.x.redis.rack_attack_url Redis.new(url: Rails.configuration.x.redis.rack_attack_url) else ActiveSupport::Cache::MemoryStore.new en...
github
ministryofjustice/laa-apply-for-legal-aid
https://github.com/ministryofjustice/laa-apply-for-legal-aid
config/initializers/filter_parameter_logging.rb
Ruby
mit
19
main
725
# Be sure to restart your server when you modify this file. # Configure parameters to be partially matched (e.g. passw matches password) and filtered from the log file. # Use this to limit dissemination of sensitive information. # See the ActiveSupport::ParameterFilter documentation for supported notations and behavio...
github
ministryofjustice/laa-apply-for-legal-aid
https://github.com/ministryofjustice/laa-apply-for-legal-aid
config/initializers/devise.rb
Ruby
mit
19
main
16,094
# frozen_string_literal: true # Use this hook to configure devise mailer, warden hooks and so forth. # Many of these configuration options can be set straight in your model. Devise.setup do |config| require "devise/models/reauthable" # ==> Configuration for custom devise extension :reauthable # The time you wa...
github
ministryofjustice/laa-apply-for-legal-aid
https://github.com/ministryofjustice/laa-apply-for-legal-aid
config/initializers/sidekiq.rb
Ruby
mit
19
main
1,706
require "sidekiq" require "sidekiq-status" require "prometheus_exporter/client" require "prometheus_exporter/instrumentation" redis_url = Rails.configuration.x.redis.base_url Sidekiq.configure_client do |config| config.redis = { url: redis_url } config.logger.level = Logger::WARN if Rails.env.test? # accepts :...
github
ministryofjustice/laa-apply-for-legal-aid
https://github.com/ministryofjustice/laa-apply-for-legal-aid
config/initializers/settings.rb
Ruby
mit
19
main
507
# The REGEXP for the postcode validation is taken from this very detailed stack overflow answer: # https://stackoverflow.com/questions/164979/uk-postcode-regex-comprehensive/51885364#51885364 # The second REGEXP from the answer section of that comment was used because as part # of the validation process we are changing...
github
ministryofjustice/laa-apply-for-legal-aid
https://github.com/ministryofjustice/laa-apply-for-legal-aid
config/initializers/omniauth.rb
Ruby
mit
19
main
2,821
Rails.application.reloader.to_prepare do require Rails.root.join "app/lib/omni_auth/omni_auth_true_layer" require Rails.root.join "app/controllers/applicants/omniauth_callbacks_controller.rb" end OmniAuth.config.allowed_request_methods = %i[post get] OmniAuth.config.silence_get_warning = true # Warnings silenced f...
github
ministryofjustice/laa-apply-for-legal-aid
https://github.com/ministryofjustice/laa-apply-for-legal-aid
config/initializers/sentry.rb
Ruby
mit
19
main
912
require "sentry-ruby" require "sentry-rails" require "sentry-sidekiq" require "active_support/parameter_filter" if %w[production].include?(Rails.env) && ENV["SENTRY_DSN"].present? Sentry.init do |config| config.dsn = ENV.fetch("SENTRY_DSN", nil) filter = ActiveSupport::ParameterFilter.new(Rails.application....
github
ministryofjustice/laa-apply-for-legal-aid
https://github.com/ministryofjustice/laa-apply-for-legal-aid
config/initializers/form_builder_extensions.rb
Ruby
mit
19
main
223
ActiveSupport.on_load(:action_view) do require_dependency Rails.root.join("app/form_builders/form_builder_extensions/field_helpers").to_s ActionView::Helpers::FormBuilder.include FormBuilderExtensions::FieldHelpers end
github
ministryofjustice/laa-apply-for-legal-aid
https://github.com/ministryofjustice/laa-apply-for-legal-aid
config/initializers/strong_migrations.rb
Ruby
mit
19
main
973
# Mark existing migrations as safe # rubocop:disable Style/NumericLiterals StrongMigrations.start_after = 20221017093914 # rubocop:enable Style/NumericLiterals # Set timeouts for migrations # If you use PgBouncer in transaction mode, delete these lines and set timeouts on the database user StrongMigrations.lock_timeou...
github
ministryofjustice/laa-apply-for-legal-aid
https://github.com/ministryofjustice/laa-apply-for-legal-aid
config/initializers/session_store.rb
Ruby
mit
19
main
287
# config/initializers/session_store.rb # set secure: true, optionally only do this for certain Rails environments (e.g., Staging / Production Rails.application.config.session_store :cookie_store, key: "_laa_apply_for_legal_aid_session", secure: ENV["INFRASTRUCTURE_ENV"] == "production"
github
ministryofjustice/laa-apply-for-legal-aid
https://github.com/ministryofjustice/laa-apply-for-legal-aid
config/environments/development.rb
Ruby
mit
19
main
3,659
require "active_support/core_ext/integer/time" Rails.application.configure do # Settings specified here will take precedence over those in config/application.rb. # Make code changes take effect immediately without server restart. config.enable_reloading = true # Do not eager load code on boot. config.eager...
github
ministryofjustice/laa-apply-for-legal-aid
https://github.com/ministryofjustice/laa-apply-for-legal-aid
config/environments/production.rb
Ruby
mit
19
main
4,856
require "active_support/core_ext/integer/time" Rails.application.configure do # Settings specified here will take precedence over those in config/application.rb. # Code is not reloaded between requests. config.enable_reloading = false # Eager load code on boot for better performance and memory savings (ignor...
github
ministryofjustice/laa-apply-for-legal-aid
https://github.com/ministryofjustice/laa-apply-for-legal-aid
config/environments/test.rb
Ruby
mit
19
main
4,704
# The test environment is used exclusively to run your application's # test suite. You never need to work with it otherwise. Remember that # your test database is "scratch space" for the test suite and is wiped # and recreated between test runs. Don't rely on the data there! Rails.application.configure do # Settings...
github
ministryofjustice/laa-apply-for-legal-aid
https://github.com/ministryofjustice/laa-apply-for-legal-aid
gems/moj-components/moj-components.gemspec
Ruby
mit
19
main
1,858
# frozen_string_literal: true require_relative "lib/moj_component/version" Gem::Specification.new do |spec| spec.name = "moj-components" spec.version = MojComponent::VERSION spec.authors = ["Ministry of Justice"] spec.email = ["apply-for-legal-aid@justice.gov.uk"] spec.summary = "MoJ Components library for...
github
ministryofjustice/laa-apply-for-legal-aid
https://github.com/ministryofjustice/laa-apply-for-legal-aid
gems/moj-components/Gemfile
Ruby
mit
19
main
258
# frozen_string_literal: true source "https://rubygems.org" # Specify your gem's dependencies in moj-components.gemspec gemspec gem "irb" gem "rake", "~> 13.0" gem "rspec", "~> 3.0" group :development, :test do gem "rubocop-govuk", require: false end
github
ministryofjustice/laa-apply-for-legal-aid
https://github.com/ministryofjustice/laa-apply-for-legal-aid
gems/moj-components/app/components/application_component.rb
Ruby
mit
19
main
204
# frozen_string_literal: true class ApplicationComponent < ViewComponent::Base include GovukVisuallyHiddenHelper include GovukLinkHelper include GovukComponentsHelper include GovukListHelper end
github
ministryofjustice/laa-apply-for-legal-aid
https://github.com/ministryofjustice/laa-apply-for-legal-aid
gems/moj-components/app/components/moj_component/alert_component.rb
Ruby
mit
19
main
783
# frozen_string_literal: true module MojComponent class AlertComponent < ApplicationComponent attr_reader :type, :heading, :body, :dismiss_href, :dismiss_text, :dismiss_method def initialize(type:, heading:, body:, dismiss_href:...
github
ministryofjustice/laa-apply-for-legal-aid
https://github.com/ministryofjustice/laa-apply-for-legal-aid
gems/moj-components/app/components/moj_component/interruption_card_component.rb
Ruby
mit
19
main
268
# frozen_string_literal: true module MojComponent class InterruptionCardComponent < ApplicationComponent attr_reader :heading renders_one :body renders_one :actions def initialize(heading:) @heading = heading super() end end end
github
ministryofjustice/laa-apply-for-legal-aid
https://github.com/ministryofjustice/laa-apply-for-legal-aid
gems/moj-components/app/components/moj_component/sub_navigation_component.rb
Ruby
mit
19
main
704
# frozen_string_literal: true module MojComponent class SubNavigationComponent < ApplicationComponent renders_many :navigation_items, "NavigationItem" class NavigationItem < ApplicationComponent attr_reader :text, :href, :current def initialize(text:, href: "#", current: nil) @text = te...
github
ministryofjustice/laa-apply-for-legal-aid
https://github.com/ministryofjustice/laa-apply-for-legal-aid
gems/moj-components/app/components/moj_component/header_component.rb
Ruby
mit
19
main
1,047
# frozen_string_literal: true module MojComponent class HeaderComponent < ApplicationComponent renders_many :navigation_items, "NavigationItem" attr_reader :organisation_name, :url, :new_tab, :nav_items def initialize(organisation_name:, url:, new_tab: fa...
github
ministryofjustice/laa-apply-for-legal-aid
https://github.com/ministryofjustice/laa-apply-for-legal-aid
gems/moj-components/app/helpers/moj_component/helpers.rb
Ruby
mit
19
main
471
# frozen_string_literal: true module MojComponent module Helpers def moj_alert(**, &) render(MojComponent::AlertComponent.new(**), &) end def moj_header(**, &) render(MojComponent::HeaderComponent.new(**), &) end def moj_interruption_card(**, &) render(MojComponent::Interrupti...
github
ministryofjustice/laa-apply-for-legal-aid
https://github.com/ministryofjustice/laa-apply-for-legal-aid
gems/moj-components/lib/moj_component/railtie.rb
Ruby
mit
19
main
864
# gems/moj-components/lib/moj/component/railtie.rb # frozen_string_literal: true require "rails/railtie" module MojComponent class Railtie < ::Rails::Railtie GEM_ROOT = Pathname(__dir__).join("..", "..").expand_path initializer "moj_component.autoload", before: "action_view.set_configs" do loader = R...
github
ministryofjustice/laa-apply-for-legal-aid
https://github.com/ministryofjustice/laa-apply-for-legal-aid
gems/moj-components/spec/spec_helper.rb
Ruby
mit
19
main
377
# frozen_string_literal: true require "moj/components" RSpec.configure do |config| # Enable flags like --only-failures and --next-failure config.example_status_persistence_file_path = ".rspec_status" # Disable RSpec exposing methods globally on `Module` and `main` config.disable_monkey_patching! config.ex...
github
ministryofjustice/laa-apply-for-legal-aid
https://github.com/ministryofjustice/laa-apply-for-legal-aid
gems/moj-components/spec/components/moj_component/interruption_card_component_spec.rb
Ruby
mit
19
main
1,778
require "rails_helper" RSpec.describe MojComponent::InterruptionCardComponent, type: :component do subject! do render_inline(described_class.new(heading: "Heading")) end context "when interruption_card is called with a heading only" do it "renders the interruption card template with the heading only" do...
github
ministryofjustice/laa-apply-for-legal-aid
https://github.com/ministryofjustice/laa-apply-for-legal-aid
gems/moj-components/spec/components/moj_component/header_component_spec.rb
Ruby
mit
19
main
2,735
require "rails_helper" RSpec.describe MojComponent::HeaderComponent, type: :component do let(:content) do render_inline(described_class.new(organisation_name:, url:, new_tab:)) do |header| header.with_navigation_item(text: "Nav item 1", href: "nav1-url") header.with_navigation_item(text: "Nav item 2"...
github
ministryofjustice/laa-apply-for-legal-aid
https://github.com/ministryofjustice/laa-apply-for-legal-aid
gems/moj-components/spec/components/moj_component/alert_component_spec.rb
Ruby
mit
19
main
1,437
require "rails_helper" RSpec.describe MojComponent::AlertComponent, type: :component do let(:content) do render_inline( described_class.new(type:, heading:, body:, dismiss_href:, dismiss_text:, dismiss_method:), ) end let(:type) { :information } let(:heading) { "Heading text" } let(:body) { "B...
github
ministryofjustice/laa-apply-for-legal-aid
https://github.com/ministryofjustice/laa-apply-for-legal-aid
gems/moj-components/spec/components/moj_component/sub_navigation_component_spec.rb
Ruby
mit
19
main
2,202
require "rails_helper" RSpec.describe MojComponent::SubNavigationComponent, type: :component do context "when sub navigation component is called" do let(:content) do render_inline described_class.new do |component| component.with_navigation_item(text: "Nav item 1") end end context "w...
github
ministryofjustice/laa-apply-for-legal-aid
https://github.com/ministryofjustice/laa-apply-for-legal-aid
scripts/migration_hook.rb
Ruby
mit
19
main
844
#!/usr/bin/env ruby require_relative "../db/anonymise/rules" def tables_in_schema f = File.read("db/schema.rb") f.each_line.filter_map { |line| line.match(/create_table "(\w*)"/)[1] if line[/create_table/] } end def tables_in_rules @rules.keys.map(&:to_s) end puts "tables in schema: #{tables_in_schema.count}" ...
github
ministryofjustice/laa-apply-for-legal-aid
https://github.com/ministryofjustice/laa-apply-for-legal-aid
db/seeds.rb
Ruby
mit
19
main
757
# This file should contain all the record creation needed to seed the database with its default values. # The data can then be loaded with the rails db:seed command (or created alongside the database with db:setup). # # Examples: # # movies = Movie.create([{ name: 'Star Wars' }, { name: 'Lord of the Rings' }]) # Ch...
github
ministryofjustice/laa-apply-for-legal-aid
https://github.com/ministryofjustice/laa-apply-for-legal-aid
db/schema.rb
Ruby
mit
19
main
55,424
# This file is auto-generated from the current state of the database. Instead # of editing this file, please use the migrations feature of Active Record to # incrementally modify your database, and then regenerate this schema definition. # # This file is the source Rails uses to define your schema when running `bin/rai...
github
ministryofjustice/laa-apply-for-legal-aid
https://github.com/ministryofjustice/laa-apply-for-legal-aid
db/migrate/20221201085138_remove_enhanced_bank_upload_from_settings.rb
Ruby
mit
19
main
219
class RemoveEnhancedBankUploadFromSettings < ActiveRecord::Migration[7.0] def change safety_assured do remove_column :settings, :enhanced_bank_upload, :boolean, null: false, default: false end end end
github
ministryofjustice/laa-apply-for-legal-aid
https://github.com/ministryofjustice/laa-apply-for-legal-aid
db/migrate/20210616092032_remove_proceeding_before_the_courts_from_chances_of_successes.rb
Ruby
mit
19
main
284
class RemoveProceedingBeforeTheCourtsFromChancesOfSuccesses < ActiveRecord::Migration[6.1] def change remove_column :chances_of_successes, :proceedings_before_the_court, :boolean remove_column :chances_of_successes, :details_of_proceedings_before_the_court, :text end end
github
ministryofjustice/laa-apply-for-legal-aid
https://github.com/ministryofjustice/laa-apply-for-legal-aid
db/migrate/20230221174503_create_citizen_access_tokens.rb
Ruby
mit
19
main
364
class CreateCitizenAccessTokens < ActiveRecord::Migration[7.0] def change create_table :citizen_access_tokens, id: :uuid do |t| t.references :legal_aid_application, type: :uuid, foreign_key: { on_delete: :cascade }, null: false t.string :token, null: false, default: "" t.date :expires_on, null: ...
github
ministryofjustice/laa-apply-for-legal-aid
https://github.com/ministryofjustice/laa-apply-for-legal-aid
db/migrate/20230223154933_remove_citizen_url_from_legal_aid_applications.rb
Ruby
mit
19
main
301
class RemoveCitizenUrlFromLegalAidApplications < ActiveRecord::Migration[7.0] def change safety_assured do remove_column :legal_aid_applications, :citizen_url_id, :string, null: true remove_column :legal_aid_applications, :citizen_url_expires_on, :date, null: true end end end
github
ministryofjustice/laa-apply-for-legal-aid
https://github.com/ministryofjustice/laa-apply-for-legal-aid
db/migrate/20210201130345_create_sent_emails.rb
Ruby
mit
19
main
437
class CreateSentEmails < ActiveRecord::Migration[6.1] def change create_table :sent_emails, id: :uuid do |t| t.string :mailer t.string :mail_method t.string :addressee t.string :govuk_message_id t.string :mailer_args t.datetime :sent_at t.string :status t.datetime :...
github
ministryofjustice/laa-apply-for-legal-aid
https://github.com/ministryofjustice/laa-apply-for-legal-aid
db/migrate/20190219134900_create_legal_aid_application_transaction_types.rb
Ruby
mit
19
main
429
class CreateLegalAidApplicationTransactionTypes < ActiveRecord::Migration[5.2] def change create_table :legal_aid_application_transaction_types, id: :uuid do |t| t.references :legal_aid_application, index: { name: :laa_trans_type_on_legal_aid_application_id }, type: :uuid t.references :transaction_typ...
github
ministryofjustice/laa-apply-for-legal-aid
https://github.com/ministryofjustice/laa-apply-for-legal-aid
db/migrate/20221108091755_create_final_hearings.rb
Ruby
mit
19
main
477
class CreateFinalHearings < ActiveRecord::Migration[7.0] def change create_table :final_hearings, id: :uuid do |t| t.belongs_to :proceeding, null: false, foreign_key: true, type: :uuid t.integer :work_type t.boolean :listed, null: false t.date :date, null: true t.string :details, nul...
github
ministryofjustice/laa-apply-for-legal-aid
https://github.com/ministryofjustice/laa-apply-for-legal-aid
db/migrate/20210712112003_add_no_cash_income_and_outgoings.rb
Ruby
mit
19
main
223
class AddNoCashIncomeAndOutgoings < ActiveRecord::Migration[6.1] def change add_column :legal_aid_applications, :no_cash_income, :boolean add_column :legal_aid_applications, :no_cash_outgoings, :boolean end end
github
ministryofjustice/laa-apply-for-legal-aid
https://github.com/ministryofjustice/laa-apply-for-legal-aid
db/migrate/20210408162032_add_delegated_functions_date_to_application_proceeding_types.rb
Ruby
mit
19
main
287
class AddDelegatedFunctionsDateToApplicationProceedingTypes < ActiveRecord::Migration[6.1] def change add_column :application_proceeding_types, :used_delegated_functions_on, :date add_column :application_proceeding_types, :used_delegated_functions_reported_on, :date end end
github
ministryofjustice/laa-apply-for-legal-aid
https://github.com/ministryofjustice/laa-apply-for-legal-aid
db/migrate/20230226121859_create_parties_mental_capacity.rb
Ruby
mit
19
main
370
class CreatePartiesMentalCapacity < ActiveRecord::Migration[7.0] def change create_table :parties_mental_capacities, id: :uuid do |t| t.belongs_to :legal_aid_application, null: false, foreign_key: true, type: :uuid t.boolean :understands_terms_of_court_order t.text :understands_terms_of_court_or...
github
ministryofjustice/laa-apply-for-legal-aid
https://github.com/ministryofjustice/laa-apply-for-legal-aid
db/migrate/20220223141651_create_employment_payments.rb
Ruby
mit
19
main
552
class CreateEmploymentPayments < ActiveRecord::Migration[6.1] def change create_table :employment_payments, id: :uuid do |t| t.references :employment, foreign_key: true, type: :uuid t.date :date, null: false t.decimal :gross, default: 0.0, null: false t.decimal :benefits_in_kind, default: ...
github
ministryofjustice/laa-apply-for-legal-aid
https://github.com/ministryofjustice/laa-apply-for-legal-aid
db/migrate/20190329154206_change_checking_answers_state_name.rb
Ruby
mit
19
main
533
class ChangeCheckingAnswersStateName < ActiveRecord::Migration[5.2] def up LegalAidApplication.where(state: :checking_answers).update_all(state: :checking_client_details_answers) LegalAidApplication.where(state: :answers_checked).update_all(state: :client_details_answers_checked) end def down LegalAi...
github
ministryofjustice/laa-apply-for-legal-aid
https://github.com/ministryofjustice/laa-apply-for-legal-aid
db/migrate/20190315133344_add_transaction_tracking_to_legal_aid_applications.rb
Ruby
mit
19
main
339
class AddTransactionTrackingToLegalAidApplications < ActiveRecord::Migration[5.2] def change add_column :legal_aid_applications, :transaction_period_start_at, :datetime add_column :legal_aid_applications, :transaction_period_finish_at, :datetime add_column :legal_aid_applications, :transactions_gathered, ...
github
ministryofjustice/laa-apply-for-legal-aid
https://github.com/ministryofjustice/laa-apply-for-legal-aid
db/migrate/20181211125447_create_saving_amounts.rb
Ruby
mit
19
main
498
class CreateSavingAmounts < ActiveRecord::Migration[5.2] def change create_table :savings_amounts, id: :uuid do |t| t.belongs_to :legal_aid_application, foreign_key: true, null: false, type: :uuid t.decimal :isa t.decimal :cash t.decimal :other_person_account t.decimal :national_savi...
github
ministryofjustice/laa-apply-for-legal-aid
https://github.com/ministryofjustice/laa-apply-for-legal-aid
db/migrate/20230215160839_remove_true_layer_secure_data_id_from_applicants.rb
Ruby
mit
19
main
200
class RemoveTrueLayerSecureDataIdFromApplicants < ActiveRecord::Migration[7.0] def change safety_assured { remove_column :applicants, :true_layer_secure_data_id, :string, null: true } end end
github
ministryofjustice/laa-apply-for-legal-aid
https://github.com/ministryofjustice/laa-apply-for-legal-aid
db/migrate/20201006122951_add_discarded_at_to_legal_aid_application.rb
Ruby
mit
19
main
214
class AddDiscardedAtToLegalAidApplication < ActiveRecord::Migration[6.0] def change add_column :legal_aid_applications, :discarded_at, :datetime add_index :legal_aid_applications, :discarded_at end end
github
ministryofjustice/laa-apply-for-legal-aid
https://github.com/ministryofjustice/laa-apply-for-legal-aid
db/migrate/20230131084513_add_banking_paths_to_application_digest.rb
Ruby
mit
19
main
340
class AddBankingPathsToApplicationDigest < ActiveRecord::Migration[7.0] def change safety_assured do change_table :application_digests, bulk: true do |t| t.boolean :true_layer_path, null: true t.boolean :bank_statements_path, null: true t.boolean :true_layer_data, null: true en...
github
ministryofjustice/laa-apply-for-legal-aid
https://github.com/ministryofjustice/laa-apply-for-legal-aid
db/migrate/20211102101801_create_application_digest_table.rb
Ruby
mit
19
main
935
class CreateApplicationDigestTable < ActiveRecord::Migration[6.1] def change create_table :application_digests, id: :uuid do |t| t.uuid :legal_aid_application_id, null: false t.string :firm_name, null: false t.string :provider_username, null: false t.date :date_started, null: false t...
github
ministryofjustice/laa-apply-for-legal-aid
https://github.com/ministryofjustice/laa-apply-for-legal-aid
db/migrate/20220915104106_add_regular_transactions_indexes.rb
Ruby
mit
19
main
291
class AddRegularTransactionsIndexes < ActiveRecord::Migration[7.0] disable_ddl_transaction! def change add_index :regular_transactions, :legal_aid_application_id, algorithm: :concurrently add_index :regular_transactions, :transaction_type_id, algorithm: :concurrently end end
github
ministryofjustice/laa-apply-for-legal-aid
https://github.com/ministryofjustice/laa-apply-for-legal-aid
db/migrate/20200708102815_create_permissions_table.rb
Ruby
mit
19
main
237
class CreatePermissionsTable < ActiveRecord::Migration[6.0] def change create_table :permissions, id: :uuid do |t| t.string :role t.string :description end add_index :permissions, :role, unique: true end end
github
ministryofjustice/laa-apply-for-legal-aid
https://github.com/ministryofjustice/laa-apply-for-legal-aid
db/migrate/20230821070336_add_owner_to_cash_transaction.rb
Ruby
mit
19
main
243
class AddOwnerToCashTransaction < ActiveRecord::Migration[7.0] def change safety_assured do change_table :cash_transactions, bulk: true do |t| t.belongs_to :owner, polymorphic: true, type: :uuid end end end end
github
ministryofjustice/laa-apply-for-legal-aid
https://github.com/ministryofjustice/laa-apply-for-legal-aid
db/migrate/20190214170843_add_uploader_to_statement_of_case.rb
Ruby
mit
19
main
256
class AddUploaderToStatementOfCase < ActiveRecord::Migration[5.2] def change add_reference :statement_of_cases, :provider_uploader, type: :uuid, index: true add_foreign_key :statement_of_cases, :providers, column: :provider_uploader_id end end
github
ministryofjustice/laa-apply-for-legal-aid
https://github.com/ministryofjustice/laa-apply-for-legal-aid
db/migrate/20190617075535_add_substantive_application_deadline_on_to_legal_aid_applications.rb
Ruby
mit
19
main
277
class AddSubstantiveApplicationDeadlineOnToLegalAidApplications < ActiveRecord::Migration[5.2] def change add_column :legal_aid_applications, :substantive_application_deadline_on, :date add_column :legal_aid_applications, :substantive_application, :boolean end end
github
ministryofjustice/laa-apply-for-legal-aid
https://github.com/ministryofjustice/laa-apply-for-legal-aid
db/migrate/20181018165257_add_foreign_keys.rb
Ruby
mit
19
main
276
class AddForeignKeys < ActiveRecord::Migration[5.2] def change add_foreign_key :application_proceeding_types, :proceeding_types add_foreign_key :application_proceeding_types, :legal_aid_applications add_foreign_key :legal_aid_applications, :applicants end end
github
ministryofjustice/laa-apply-for-legal-aid
https://github.com/ministryofjustice/laa-apply-for-legal-aid
db/migrate/20230228132829_update_opponent_fields.rb
Ruby
mit
19
main
432
class UpdateOpponentFields < ActiveRecord::Migration[7.0] def change safety_assured do remove_columns :opponents, :understands_terms_of_court_order_details, :warning_letter_sent_details, :police_notified_details, :bail_conditions_set_details, type: :string remove_columns :opponents, :understands_terms...
github
ministryofjustice/laa-apply-for-legal-aid
https://github.com/ministryofjustice/laa-apply-for-legal-aid
db/migrate/20190319145411_create_settings.rb
Ruby
mit
19
main
215
class CreateSettings < ActiveRecord::Migration[5.2] def change create_table :settings, id: :uuid do |t| t.timestamps t.boolean :mock_true_layer_data, null: false, default: false end end end
github
ministryofjustice/laa-apply-for-legal-aid
https://github.com/ministryofjustice/laa-apply-for-legal-aid
db/migrate/20241206121926_destroy_student_loan_transaction_type.rb
Ruby
mit
19
main
890
class DestroyStudentLoanTransactionType < ActiveRecord::Migration[7.2] disable_ddl_transaction! def up TransactionType.find_by(name: 'student_loan')&.destroy! # reset sort_order attribute of all transaction types Populators::TransactionTypePopulator.call end def down # Irreversible data migra...
github
ministryofjustice/laa-apply-for-legal-aid
https://github.com/ministryofjustice/laa-apply-for-legal-aid
db/migrate/20221117155146_destroy_redundant_irregular_incomes.rb
Ruby
mit
19
main
380
class DestroyRedundantIrregularIncomes < ActiveRecord::Migration[7.0] disable_ddl_transaction! def up LegalAidApplication.where(student_finance: false).find_in_batches do |legal_aid_applications| legal_aid_applications.each do |legal_aid_application| legal_aid_application.irregular_incomes.destro...
github
ministryofjustice/laa-apply-for-legal-aid
https://github.com/ministryofjustice/laa-apply-for-legal-aid
db/migrate/20190701120930_create_opponents.rb
Ruby
mit
19
main
511
class CreateOpponents < ActiveRecord::Migration[5.2] def change create_table :opponents, id: :uuid do |t| t.string :other_party_id t.string :title t.string :first_name t.string :surname t.date :date_of_birth t.string :relationship_to_client t.string :relationship_to_case ...
github
ministryofjustice/laa-apply-for-legal-aid
https://github.com/ministryofjustice/laa-apply-for-legal-aid
db/migrate/20230727104111_create_organisations.rb
Ruby
mit
19
main
274
class CreateOrganisations < ActiveRecord::Migration[7.0] def change create_table :organisations, id: :uuid do |t| t.string "name", null: false t.string "ccms_code", null: false t.string "description", null: false t.timestamps end end end
github
ministryofjustice/laa-apply-for-legal-aid
https://github.com/ministryofjustice/laa-apply-for-legal-aid
db/migrate/20221101141154_create_vary_order.rb
Ruby
mit
19
main
252
class CreateVaryOrder < ActiveRecord::Migration[7.0] def change create_table :vary_orders, id: :uuid do |t| t.belongs_to :proceeding, null: false, foreign_key: true, type: :uuid t.string :details t.timestamps end end end
github
ministryofjustice/laa-apply-for-legal-aid
https://github.com/ministryofjustice/laa-apply-for-legal-aid
db/migrate/20220204114732_drop_proceeding_type_tables.rb
Ruby
mit
19
main
455
class DropProceedingTypeTables < ActiveRecord::Migration[6.1] def up drop_table :application_proceeding_types, force: :cascade drop_table :proceeding_types, force: :cascade drop_table :scope_limitations, force: :cascade drop_table :proceeding_type_scope_limitations, force: :cascade drop_table :app...
github
ministryofjustice/laa-apply-for-legal-aid
https://github.com/ministryofjustice/laa-apply-for-legal-aid
db/migrate/20230202115351_remove_full_loop_from_settings.rb
Ruby
mit
19
main
200
class RemoveFullLoopFromSettings < ActiveRecord::Migration[7.0] def change safety_assured do remove_column :settings, :enable_loop, :boolean, null: false, default: false end end end
github
ministryofjustice/laa-apply-for-legal-aid
https://github.com/ministryofjustice/laa-apply-for-legal-aid
db/migrate/20190705150936_create_proceeding_type_scope_limitations.rb
Ruby
mit
19
main
1,149
class CreateProceedingTypeScopeLimitations < ActiveRecord::Migration[5.2] def change create_table :proceeding_type_scope_limitations, id: :uuid do |t| t.references :proceeding_type, type: :uuid, foreign_key: true t.references :scope_limitation, type: :uuid, foreign_key: true t.boolean :substanti...
github
ministryofjustice/laa-apply-for-legal-aid
https://github.com/ministryofjustice/laa-apply-for-legal-aid
db/migrate/20181107110620_create_true_layer_models.rb
Ruby
mit
19
main
1,663
class CreateTrueLayerModels < ActiveRecord::Migration[5.2] def change create_table :bank_providers, id: :uuid do |t| t.belongs_to :applicant, foreign_key: true, null: false, type: :uuid t.json :true_layer_response t.string :credentials_id t.string :token t.datetime :token_expires_at ...
github
ministryofjustice/laa-apply-for-legal-aid
https://github.com/ministryofjustice/laa-apply-for-legal-aid
db/migrate/20181011143410_create_addresses.rb
Ruby
mit
19
main
358
class CreateAddresses < ActiveRecord::Migration[5.2] def change create_table :addresses, id: :uuid do |t| t.string :address_line_one t.string :address_line_two t.string :city t.string :county t.string :postcode t.references :applicant, foreign_key: true, null: false t.tim...
github
ministryofjustice/laa-apply-for-legal-aid
https://github.com/ministryofjustice/laa-apply-for-legal-aid
db/migrate/20250121090656_drop_gateway_evidences_table.rb
Ruby
mit
19
main
348
class DropGatewayEvidencesTable < ActiveRecord::Migration[7.2] def change drop_table :gateway_evidences, id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| t.belongs_to :legal_aid_application, null: false, type: :uuid t.uuid :provider_uploader_id, type: :uuid, index: true t.t...
github
ministryofjustice/laa-apply-for-legal-aid
https://github.com/ministryofjustice/laa-apply-for-legal-aid
db/migrate/20190214171720_create_malware_scan_results.rb
Ruby
mit
19
main
325
class CreateMalwareScanResults < ActiveRecord::Migration[5.2] def change create_table :malware_scan_results, id: :uuid do |t| t.references :uploader, type: :uuid, polymorphic: true t.boolean :virus_found, null: false t.text :scan_result t.json :file_details t.timestamps end end...
github
ministryofjustice/laa-apply-for-legal-aid
https://github.com/ministryofjustice/laa-apply-for-legal-aid
db/migrate/20200501103020_convert_meta_data_to_hash.rb
Ruby
mit
19
main
518
class ConvertMetaDataToHash < ActiveRecord::Migration[6.0] # convert all existing BankTransaction records with String meta data to hash. def up BankTransaction.where.not(meta_data: nil).each do |bt| next unless bt.meta_data.is_a?(String) label = bt.meta_data bt.update!(meta_data: { label:, na...
github
ministryofjustice/laa-apply-for-legal-aid
https://github.com/ministryofjustice/laa-apply-for-legal-aid
db/migrate/20220915124637_create_scope_limitation.rb
Ruby
mit
19
main
463
class CreateScopeLimitation < ActiveRecord::Migration[7.0] def change create_table :scope_limitations, id: :uuid do |t| t.belongs_to :proceeding, null: false, foreign_key: true, type: :uuid t.integer :scope_type t.string :code, null: false t.string :meaning, null: false t.string :des...
github
ministryofjustice/laa-apply-for-legal-aid
https://github.com/ministryofjustice/laa-apply-for-legal-aid
db/migrate/20190828131723_recreate_service_levels.rb
Ruby
mit
19
main
272
class RecreateServiceLevels < ActiveRecord::Migration[5.2] def change create_table :service_levels, id: :uuid do |t| t.integer :service_level_number t.string :name t.timestamps end add_index :service_levels, :service_level_number end end
github
ministryofjustice/laa-apply-for-legal-aid
https://github.com/ministryofjustice/laa-apply-for-legal-aid
db/migrate/20181101105424_add_true_layer_token_to_applicants.rb
Ruby
mit
19
main
211
class AddTrueLayerTokenToApplicants < ActiveRecord::Migration[5.2] def change add_column :applicants, :true_layer_token, :text add_column :applicants, :true_layer_token_expires_at, :datetime end end
github
ministryofjustice/laa-apply-for-legal-aid
https://github.com/ministryofjustice/laa-apply-for-legal-aid
db/migrate/20250617140126_add_omni_auth_columns_to_providers.rb
Ruby
mit
19
main
255
class AddOmniAuthColumnsToProviders < ActiveRecord::Migration[8.0] def change # Omniauthable, custom devise add_column :providers, :auth_provider, :string, null: false, default: "" add_column :providers, :auth_subject_uid, :string end end
github
ministryofjustice/laa-apply-for-legal-aid
https://github.com/ministryofjustice/laa-apply-for-legal-aid
db/migrate/20200501083631_re_populate_transaction_types.rb
Ruby
mit
19
main
373
class RePopulateTransactionTypes < ActiveRecord::Migration[6.0] def up # rerun population method to add new excluded benefits record TransactionType.connection.schema_cache.clear! TransactionType.reset_column_information Populators::TransactionTypePopulator.call end def down TransactionType.f...
github
ministryofjustice/laa-apply-for-legal-aid
https://github.com/ministryofjustice/laa-apply-for-legal-aid
db/migrate/20201125195145_remove_estimated_legal_cost_from_merits_assessments.rb
Ruby
mit
19
main
274
class RemoveEstimatedLegalCostFromMeritsAssessments < ActiveRecord::Migration[6.0] def up remove_column :merits_assessments, :estimated_legal_cost end def down add_column :merits_assessments, :estimated_legal_cost, :decimal, precision: 10, scale: 2 end end
github
ministryofjustice/laa-apply-for-legal-aid
https://github.com/ministryofjustice/laa-apply-for-legal-aid
db/migrate/20181109095753_remove_token_from_applicant.rb
Ruby
mit
19
main
212
class RemoveTokenFromApplicant < ActiveRecord::Migration[5.2] def change remove_column :applicants, :true_layer_token, :text remove_column :applicants, :true_layer_token_expires_at, :datetime end end
github
ministryofjustice/laa-apply-for-legal-aid
https://github.com/ministryofjustice/laa-apply-for-legal-aid
db/migrate/20190611120953_add_used_delegated_functions_on_to_legal_aid_applications.rb
Ruby
mit
19
main
262
class AddUsedDelegatedFunctionsOnToLegalAidApplications < ActiveRecord::Migration[5.2] def change add_column :legal_aid_applications, :used_delegated_functions_on, :date add_column :legal_aid_applications, :used_delegated_functions, :boolean end end
github
ministryofjustice/laa-apply-for-legal-aid
https://github.com/ministryofjustice/laa-apply-for-legal-aid
db/migrate/20231004144844_remove_opponent_organisations_flag_from_settings.rb
Ruby
mit
19
main
228
class RemoveOpponentOrganisationsFlagFromSettings < ActiveRecord::Migration[7.0] def change safety_assured do remove_column :settings, :opponent_organisations, :boolean, null: false, default: false end end end
github
ministryofjustice/laa-apply-for-legal-aid
https://github.com/ministryofjustice/laa-apply-for-legal-aid
db/migrate/20190903092600_change_default_cost_limitations_from_integer_to_decimal.rb
Ruby
mit
19
main
523
class ChangeDefaultCostLimitationsFromIntegerToDecimal < ActiveRecord::Migration[5.2] def up change_column :proceeding_types, :default_cost_limitation_substantive, :decimal, precision: 8, scale: 2 change_column :proceeding_types, :default_cost_limitation_delegated_functions, :decimal, precision: 8, scale: 2 ...
github
ministryofjustice/laa-apply-for-legal-aid
https://github.com/ministryofjustice/laa-apply-for-legal-aid
db/migrate/20240216110009_add_type_to_address.rb
Ruby
mit
19
main
220
class AddTypeToAddress < ActiveRecord::Migration[7.1] def change add_column :addresses, :location, :string # Set default values for existing records Address.update_all(location: "correspondence") end end
github
ministryofjustice/laa-apply-for-legal-aid
https://github.com/ministryofjustice/laa-apply-for-legal-aid
db/migrate/20190628122520_create_dependant.rb
Ruby
mit
19
main
310
class CreateDependant < ActiveRecord::Migration[5.2] def change create_table :dependants, id: :uuid do |t| t.belongs_to :legal_aid_application, foreign_key: true, null: false, type: :uuid t.integer :number t.string :name t.date :date_of_birth t.timestamps end end end
github
ministryofjustice/laa-apply-for-legal-aid
https://github.com/ministryofjustice/laa-apply-for-legal-aid
db/migrate/20250911153550_add_omni_auth_columns_to_admin_users.rb
Ruby
mit
19
main
260
class AddOmniAuthColumnsToAdminUsers < ActiveRecord::Migration[8.0] def change # Omniauthable, custom devise add_column :admin_users, :auth_provider, :string, null: false, default: "" add_column :admin_users, :auth_subject_uid, :string end end
github
ministryofjustice/laa-apply-for-legal-aid
https://github.com/ministryofjustice/laa-apply-for-legal-aid
db/migrate/20181101115246_create_benefit_check_results.rb
Ruby
mit
19
main
305
class CreateBenefitCheckResults < ActiveRecord::Migration[5.2] def change create_table :benefit_check_results, id: :uuid do |t| t.belongs_to :legal_aid_application, foreign_key: true, null: false, type: :uuid t.string :result t.string :dwp_ref t.timestamps end end end
github
ministryofjustice/laa-apply-for-legal-aid
https://github.com/ministryofjustice/laa-apply-for-legal-aid
db/migrate/20250812154747_remove_invalid_login_details_from_providers.rb
Ruby
mit
19
main
207
class RemoveInvalidLoginDetailsFromProviders < ActiveRecord::Migration[8.0] def change safety_assured do remove_column :providers, :invalid_login_details, :string, default: nil end end end
github
ministryofjustice/laa-apply-for-legal-aid
https://github.com/ministryofjustice/laa-apply-for-legal-aid
db/migrate/20210913102726_create_default_cost_limitations.rb
Ruby
mit
19
main
372
class CreateDefaultCostLimitations < ActiveRecord::Migration[6.1] def change create_table :default_cost_limitations, id: :uuid do |t| t.belongs_to :proceeding_type, foreign_key: true, null: false, type: :uuid t.date :start_date, null: false t.string :cost_type, null: false t.decimal :value...
github
ministryofjustice/laa-apply-for-legal-aid
https://github.com/ministryofjustice/laa-apply-for-legal-aid
db/migrate/20190913092309_create_cfe_submission_history.rb
Ruby
mit
19
main
412
class CreateCFESubmissionHistory < ActiveRecord::Migration[5.2] def change create_table :cfe_submission_histories, id: :uuid do |t| t.uuid :submission_id t.string :url t.string :http_method t.text :request_payload t.integer :http_response_status t.text :response_payload t...
github
ministryofjustice/laa-apply-for-legal-aid
https://github.com/ministryofjustice/laa-apply-for-legal-aid
db/migrate/20240711135846_add_separate_representation_required_to_legal_aid_applications.rb
Ruby
mit
19
main
200
class AddSeparateRepresentationRequiredToLegalAidApplications < ActiveRecord::Migration[7.1] def change add_column :legal_aid_applications, :separate_representation_required, :boolean end end
github
ministryofjustice/laa-apply-for-legal-aid
https://github.com/ministryofjustice/laa-apply-for-legal-aid
db/migrate/20191118142348_create_attachments.rb
Ruby
mit
19
main
256
class CreateAttachments < ActiveRecord::Migration[5.2] def change create_table :attachments, id: :uuid do |t| t.uuid :legal_aid_application_id t.string :attachment_type t.uuid :pdf_attachment_id t.timestamps end end end
github
ministryofjustice/laa-apply-for-legal-aid
https://github.com/ministryofjustice/laa-apply-for-legal-aid
db/migrate/20211015111515_add_proceedings_to_attempts_to_settle.rb
Ruby
mit
19
main
263
class AddProceedingsToAttemptsToSettle < ActiveRecord::Migration[6.1] def change add_reference :attempts_to_settles, :proceeding, foreign_key: true, type: :uuid add_reference :chances_of_successes, :proceeding, foreign_key: true, type: :uuid end end
github
ministryofjustice/laa-apply-for-legal-aid
https://github.com/ministryofjustice/laa-apply-for-legal-aid
db/migrate/20250616133014_change_foreign_key_on_domestic_abuse_summaries.rb
Ruby
mit
19
main
284
class ChangeForeignKeyOnDomesticAbuseSummaries < ActiveRecord::Migration[8.0] def change remove_foreign_key :domestic_abuse_summaries, :legal_aid_applications add_foreign_key :domestic_abuse_summaries, :legal_aid_applications, on_delete: :cascade, validate: false end end